PM-767 "BPMN Designer Añr lista de messages"

> ProcessMaker-MA "Message (endpoints)"
  - Se han implementado los siguientes Endpoints:
  GET    /api/1.0/{workspace}/project/{prj_uid}/message-types/{msgt_uid}
  GET    /api/1.0/{workspace}/project/{prj_uid}/message-type/{msgt_uid}
  POST   /api/1.0/{workspace}/project/{prj_uid}/message-type
  PUT    /api/1.0/{workspace}/project/{prj_uid}/message-type/{msgt_uid}
  DELETE /api/1.0/{workspace}/project/{prj_uid}/message-type/{msgt_uid}
- Se han implementado los metodos necesarios para el Export, Import y Delete (delete Process) de este nuevo "Objeto"
This commit is contained in:
Luis Fernando Saisa Lopez
2015-02-04 17:18:32 -04:00
parent 4f1d370708
commit 02d91e90a6
26 changed files with 2227 additions and 1035 deletions

View File

@@ -663,6 +663,48 @@ class Processes
return $sNewUid;
}
/**
* Get an unused unique id for Message-Type
*
* @return string $uid
*/
public function getUnusedMessageTypeUid()
{
try {
$messageType = new \ProcessMaker\BusinessModel\MessageType();
do {
$newUid = \ProcessMaker\Util\Common::generateUID();
} while ($messageType->exists($newUid));
return $newUid;
} catch (Exception $e) {
throw $e;
}
}
/**
* Get an unused unique id for Message-Type-Variable
*
* @return string $uid
*/
public function getUnusedMessageTypeVariableUid()
{
try {
$variable = new \ProcessMaker\BusinessModel\MessageType\Variable();
do {
$newUid = \ProcessMaker\Util\Common::generateUID();
} while ($variable->exists($newUid));
return $newUid;
} catch (Exception $e) {
throw $e;
}
}
/**
* change the GUID for a serialized process
*
@@ -800,6 +842,12 @@ class Processes
}
}
if (isset($oData->messageType)) {
foreach ($oData->messageType as $key => $value) {
$oData->messageType[$key]["PRJ_UID"] = $sNewProUid;
}
}
return true;
}
@@ -2212,6 +2260,77 @@ class Processes
throw $e;
}
}
/**
* Renew all the unique id for Message-Type
*
* @param object $data Object with the data
*
* return void
*/
public function renewAllMessageTypeUid(&$data)
{
try {
$map = array();
foreach ($data->messageType as $key => $value) {
$record = $value;
if (isset($record["MSGT_UID"])) {
$newUid = $this->getUnusedMessageTypeUid();
$map[$record["MSGT_UID"]] = $newUid;
$data->messageType[$key]["MSGT_UID"] = $newUid;
}
}
$data->uid["MESSAGE_TYPE"] = $map;
if (isset($data->messageTypeVariable)) {
foreach ($data->messageTypeVariable as $key => $value) {
$record = $value;
if (isset($map[$record["MSGT_UID"]])) {
$newUid = $map[$record["MSGT_UID"]];
$data->messageTypeVariable[$key]["MSGT_UID"] = $newUid;
}
}
}
} catch (Exception $e) {
throw $e;
}
}
/**
* Renew all the unique id for Message-Type-Variable
*
* @param object $data Object with the data
*
* return void
*/
public function renewAllMessageTypeVariableUid(&$data)
{
try {
$map = array();
foreach ($data->messageTypeVariable as $key => $value) {
$record = $value;
if (isset($record["MSGTV_UID"])) {
$newUid = $this->getUnusedMessageTypeVariableUid();
$map[$record["MSGTV_UID"]] = $newUid;
$data->messageTypeVariable[$key]["MSGTV_UID"] = $newUid;
}
}
$data->uid["MESSAGE_TYPE_VARIABLE"] = $map;
} catch (Exception $e) {
throw $e;
}
}
/**
* Renew the GUID's for all the Uids for all the elements
*
@@ -2242,6 +2361,8 @@ class Processes
$this->renewAllCaseScheduler( $oData );
$this->renewAllProcessUserUid($oData);
$this->renewAllProcessVariableUid($oData);
$this->renewAllMessageTypeUid($oData);
$this->renewAllMessageTypeVariableUid($oData);
}
/**
@@ -2891,6 +3012,71 @@ class Processes
}
}
public function getMessageTypes($processUid)
{
try {
$arrayMessageType = array();
$messageType = new \ProcessMaker\BusinessModel\MessageType();
//Get data
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(MessageTypePeer::MSGT_UID);
$criteria->add(MessageTypePeer::PRJ_UID, $processUid, Criteria::EQUAL);
$rsCriteria = MessageTypePeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$arrayAux = $messageType->getMessageType($row["MSGT_UID"], true);
unset($arrayAux["MSGT_VARIABLES"]);
$arrayMessageType[] = $arrayAux;
}
//Return
return $arrayMessageType;
} catch (Exception $e) {
throw $e;
}
}
public function getMessageTypeVariables($processUid)
{
try {
$arrayVariable = array();
$variable = new \ProcessMaker\BusinessModel\MessageType\Variable();
//Get data
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(MessageTypeVariablePeer::MSGTV_UID);
$criteria->addJoin(MessageTypePeer::MSGT_UID, MessageTypeVariablePeer::MSGT_UID, Criteria::LEFT_JOIN);
$criteria->add(MessageTypePeer::PRJ_UID, $processUid, Criteria::EQUAL);
$rsCriteria = MessageTypeVariablePeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$arrayVariable[] = $variable->getMessageTypeVariable($row["MSGTV_UID"], true);
}
//Return
return $arrayVariable;
} catch (Exception $e) {
throw $e;
}
}
/**
* Get Task User Rows from an array of data
*
@@ -3079,6 +3265,59 @@ class Processes
}
}
/**
* Create Message-Type records
*
* @param array $arrayData Data
*
* return void
*/
public function createMessageType(array $arrayData)
{
try {
$messageType = new \ProcessMaker\BusinessModel\MessageType();
foreach ($arrayData as $value) {
$record = $value;
if ($messageType->exists($record["MSGT_UID"])) {
$messageType->delete($record["MSGT_UID"]);
}
$result = $messageType->singleCreate($record);
}
} catch (Exception $e) {
throw $e;
}
}
/**
* Create Message-Type-Variable records
*
* @param array $arrayData Data
*
* return void
*/
public function createMessageTypeVariable(array $arrayData)
{
try {
$variable = new \ProcessMaker\BusinessModel\MessageType\Variable();
foreach ($arrayData as $value) {
$record = $value;
if ($variable->exists($record["MSGTV_UID"])) {
$variable->delete($record["MSGTV_UID"]);
}
$result = $variable->singleCreate($record);
}
} catch (Exception $e) {
throw $e;
}
}
/**
* Cleanup Report Tables References from an array of data
*
@@ -3265,7 +3504,8 @@ class Processes
$oData->processVariables = $this->getProcessVariables($sProUid);
$oData->webEntry = $this->getWebEntries($sProUid);
$oData->webEntryEvent = $this->getWebEntryEvents($sProUid);
$oData->messageType = $this->getMessageTypes($sProUid);
$oData->messageTypeVariable = $this->getMessageTypeVariables($sProUid);
$oData->groupwfs = $this->groupwfsMerge($oData->groupwfs, $oData->processUser, "USR_UID");
$oData->process["PRO_TYPE_PROCESS"] = "PUBLIC";
@@ -4310,6 +4550,8 @@ class Processes
$this->createProcessVariables((isset($oData->processVariables))? $oData->processVariables : array());
$this->createWebEntry($arrayProcessData["PRO_UID"], $arrayProcessData["PRO_CREATE_USER"], (isset($oData->webEntry))? $oData->webEntry : array());
$this->createWebEntryEvent($arrayProcessData["PRO_UID"], $arrayProcessData["PRO_CREATE_USER"], (isset($oData->webEntryEvent))? $oData->webEntryEvent : array());
$this->createMessageType((isset($oData->messageType))? $oData->messageType : array());
$this->createMessageTypeVariable((isset($oData->messageTypeVariable))? $oData->messageTypeVariable : array());
}

View File

@@ -1,19 +0,0 @@
<?php
require_once 'classes/model/om/BaseMessage.php';
/**
* Skeleton subclass for representing a row from the 'MESSAGE' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class Message extends BaseMessage {
} // Message

View File

@@ -1,19 +0,0 @@
<?php
require_once 'classes/model/om/BaseMessageDetail.php';
/**
* Skeleton subclass for representing a row from the 'MESSAGE_DETAIL' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class MessageDetail extends BaseMessageDetail {
} // MessageDetail

View File

@@ -1,23 +0,0 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseMessageDetailPeer.php';
// include object class
include_once 'classes/model/MessageDetail.php';
/**
* Skeleton subclass for performing query and update operations on the 'MESSAGE_DETAIL' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class MessageDetailPeer extends BaseMessageDetailPeer {
} // MessageDetailPeer

View File

@@ -1,23 +0,0 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseMessagePeer.php';
// include object class
include_once 'classes/model/Message.php';
/**
* Skeleton subclass for performing query and update operations on the 'MESSAGE' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class MessagePeer extends BaseMessagePeer {
} // MessagePeer

View File

@@ -0,0 +1,5 @@
<?php
class MessageType extends BaseMessageType
{
}

View File

@@ -0,0 +1,5 @@
<?php
class MessageTypePeer extends BaseMessageTypePeer
{
}

View File

@@ -0,0 +1,5 @@
<?php
class MessageTypeVariable extends BaseMessageTypeVariable
{
}

View File

@@ -0,0 +1,5 @@
<?php
class MessageTypeVariablePeer extends BaseMessageTypeVariablePeer
{
}

View File

@@ -5,7 +5,7 @@ include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'MESSAGE' table to 'workflow' DatabaseMap object.
* This class adds structure of 'MESSAGE_TYPE' table to 'workflow' DatabaseMap object.
*
*
*
@@ -16,13 +16,13 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
class MessageMapBuilder
class MessageTypeMapBuilder
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.MessageMapBuilder';
const CLASS_NAME = 'classes.model.map.MessageTypeMapBuilder';
/**
* The database map.
@@ -60,19 +60,17 @@ class MessageMapBuilder
{
$this->dbMap = Propel::getDatabaseMap('workflow');
$tMap = $this->dbMap->addTable('MESSAGE');
$tMap->setPhpName('Message');
$tMap = $this->dbMap->addTable('MESSAGE_TYPE');
$tMap->setPhpName('MessageType');
$tMap->setUseIdGenerator(false);
$tMap->addPrimaryKey('MES_UID', 'MesUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addPrimaryKey('MSGT_UID', 'MsgtUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('PRJ_UID', 'PrjUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('MES_NAME', 'MesName', 'string', CreoleTypes::VARCHAR, false, 255);
$tMap->addColumn('MES_CONDITION', 'MesCondition', 'string', CreoleTypes::VARCHAR, false, 255);
$tMap->addColumn('MSGT_NAME', 'MsgtName', 'string', CreoleTypes::VARCHAR, false, 512);
} // doBuild()
} // MessageMapBuilder
} // MessageTypeMapBuilder

View File

@@ -5,7 +5,7 @@ include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'MESSAGE_DETAIL' table to 'workflow' DatabaseMap object.
* This class adds structure of 'MESSAGE_TYPE_VARIABLE' table to 'workflow' DatabaseMap object.
*
*
*
@@ -16,13 +16,13 @@ include_once 'creole/CreoleTypes.php';
*
* @package workflow.classes.model.map
*/
class MessageDetailMapBuilder
class MessageTypeVariableMapBuilder
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.MessageDetailMapBuilder';
const CLASS_NAME = 'classes.model.map.MessageTypeVariableMapBuilder';
/**
* The database map.
@@ -60,19 +60,19 @@ class MessageDetailMapBuilder
{
$this->dbMap = Propel::getDatabaseMap('workflow');
$tMap = $this->dbMap->addTable('MESSAGE_DETAIL');
$tMap->setPhpName('MessageDetail');
$tMap = $this->dbMap->addTable('MESSAGE_TYPE_VARIABLE');
$tMap->setPhpName('MessageTypeVariable');
$tMap->setUseIdGenerator(false);
$tMap->addPrimaryKey('MD_UID', 'MdUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addPrimaryKey('MSGTV_UID', 'MsgtvUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('MES_UID', 'MesUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('MSGT_UID', 'MsgtUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('MD_TYPE', 'MdType', 'string', CreoleTypes::VARCHAR, false, 32);
$tMap->addColumn('MSGTV_NAME', 'MsgtvName', 'string', CreoleTypes::VARCHAR, false, 512);
$tMap->addColumn('MD_NAME', 'MdName', 'string', CreoleTypes::VARCHAR, false, 255);
$tMap->addColumn('MSGTV_DEFAULT_VALUE', 'MsgtvDefaultValue', 'string', CreoleTypes::VARCHAR, false, 512);
} // doBuild()
} // MessageDetailMapBuilder
} // MessageTypeVariableMapBuilder

View File

@@ -7,31 +7,31 @@ require_once 'propel/om/Persistent.php';
include_once 'propel/util/Criteria.php';
include_once 'classes/model/MessagePeer.php';
include_once 'classes/model/MessageTypePeer.php';
/**
* Base class that represents a row from the 'MESSAGE' table.
* Base class that represents a row from the 'MESSAGE_TYPE' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BaseMessage extends BaseObject implements Persistent
abstract class BaseMessageType 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 MessagePeer
* @var MessageTypePeer
*/
protected static $peer;
/**
* The value for the mes_uid field.
* The value for the msgt_uid field.
* @var string
*/
protected $mes_uid;
protected $msgt_uid;
/**
* The value for the prj_uid field.
@@ -40,16 +40,10 @@ abstract class BaseMessage extends BaseObject implements Persistent
protected $prj_uid;
/**
* The value for the mes_name field.
* The value for the msgt_name field.
* @var string
*/
protected $mes_name = '';
/**
* The value for the mes_condition field.
* @var string
*/
protected $mes_condition = '';
protected $msgt_name = '';
/**
* Flag to prevent endless save loop, if this object is referenced
@@ -66,14 +60,14 @@ abstract class BaseMessage extends BaseObject implements Persistent
protected $alreadyInValidation = false;
/**
* Get the [mes_uid] column value.
* Get the [msgt_uid] column value.
*
* @return string
*/
public function getMesUid()
public function getMsgtUid()
{
return $this->mes_uid;
return $this->msgt_uid;
}
/**
@@ -88,34 +82,23 @@ abstract class BaseMessage extends BaseObject implements Persistent
}
/**
* Get the [mes_name] column value.
* Get the [msgt_name] column value.
*
* @return string
*/
public function getMesName()
public function getMsgtName()
{
return $this->mes_name;
return $this->msgt_name;
}
/**
* Get the [mes_condition] column value.
*
* @return string
*/
public function getMesCondition()
{
return $this->mes_condition;
}
/**
* Set the value of [mes_uid] column.
* Set the value of [msgt_uid] column.
*
* @param string $v new value
* @return void
*/
public function setMesUid($v)
public function setMsgtUid($v)
{
// Since the native PHP type for this column is string,
@@ -124,12 +107,12 @@ abstract class BaseMessage extends BaseObject implements Persistent
$v = (string) $v;
}
if ($this->mes_uid !== $v) {
$this->mes_uid = $v;
$this->modifiedColumns[] = MessagePeer::MES_UID;
if ($this->msgt_uid !== $v) {
$this->msgt_uid = $v;
$this->modifiedColumns[] = MessageTypePeer::MSGT_UID;
}
} // setMesUid()
} // setMsgtUid()
/**
* Set the value of [prj_uid] column.
@@ -148,18 +131,18 @@ abstract class BaseMessage extends BaseObject implements Persistent
if ($this->prj_uid !== $v) {
$this->prj_uid = $v;
$this->modifiedColumns[] = MessagePeer::PRJ_UID;
$this->modifiedColumns[] = MessageTypePeer::PRJ_UID;
}
} // setPrjUid()
/**
* Set the value of [mes_name] column.
* Set the value of [msgt_name] column.
*
* @param string $v new value
* @return void
*/
public function setMesName($v)
public function setMsgtName($v)
{
// Since the native PHP type for this column is string,
@@ -168,34 +151,12 @@ abstract class BaseMessage extends BaseObject implements Persistent
$v = (string) $v;
}
if ($this->mes_name !== $v || $v === '') {
$this->mes_name = $v;
$this->modifiedColumns[] = MessagePeer::MES_NAME;
if ($this->msgt_name !== $v || $v === '') {
$this->msgt_name = $v;
$this->modifiedColumns[] = MessageTypePeer::MSGT_NAME;
}
} // setMesName()
/**
* Set the value of [mes_condition] column.
*
* @param string $v new value
* @return void
*/
public function setMesCondition($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->mes_condition !== $v || $v === '') {
$this->mes_condition = $v;
$this->modifiedColumns[] = MessagePeer::MES_CONDITION;
}
} // setMesCondition()
} // setMsgtName()
/**
* Hydrates (populates) the object variables with values from the database resultset.
@@ -214,23 +175,21 @@ abstract class BaseMessage extends BaseObject implements Persistent
{
try {
$this->mes_uid = $rs->getString($startcol + 0);
$this->msgt_uid = $rs->getString($startcol + 0);
$this->prj_uid = $rs->getString($startcol + 1);
$this->mes_name = $rs->getString($startcol + 2);
$this->mes_condition = $rs->getString($startcol + 3);
$this->msgt_name = $rs->getString($startcol + 2);
$this->resetModified();
$this->setNew(false);
// FIXME - using NUM_COLUMNS may be clearer.
return $startcol + 4; // 4 = MessagePeer::NUM_COLUMNS - MessagePeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 3; // 3 = MessageTypePeer::NUM_COLUMNS - MessageTypePeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating Message object", $e);
throw new PropelException("Error populating MessageType object", $e);
}
}
@@ -250,12 +209,12 @@ abstract class BaseMessage extends BaseObject implements Persistent
}
if ($con === null) {
$con = Propel::getConnection(MessagePeer::DATABASE_NAME);
$con = Propel::getConnection(MessageTypePeer::DATABASE_NAME);
}
try {
$con->begin();
MessagePeer::doDelete($this, $con);
MessageTypePeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
@@ -281,7 +240,7 @@ abstract class BaseMessage extends BaseObject implements Persistent
}
if ($con === null) {
$con = Propel::getConnection(MessagePeer::DATABASE_NAME);
$con = Propel::getConnection(MessageTypePeer::DATABASE_NAME);
}
try {
@@ -316,14 +275,14 @@ abstract class BaseMessage extends BaseObject implements Persistent
// If this object has been modified, then save it to the database.
if ($this->isModified()) {
if ($this->isNew()) {
$pk = MessagePeer::doInsert($this, $con);
$pk = MessageTypePeer::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 += MessagePeer::doUpdate($this, $con);
$affectedRows += MessageTypePeer::doUpdate($this, $con);
}
$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
}
@@ -394,7 +353,7 @@ abstract class BaseMessage extends BaseObject implements Persistent
$failureMap = array();
if (($retval = MessagePeer::doValidate($this, $columns)) !== true) {
if (($retval = MessageTypePeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
@@ -417,7 +376,7 @@ abstract class BaseMessage extends BaseObject implements Persistent
*/
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = MessagePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
$pos = MessageTypePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
@@ -432,16 +391,13 @@ abstract class BaseMessage extends BaseObject implements Persistent
{
switch($pos) {
case 0:
return $this->getMesUid();
return $this->getMsgtUid();
break;
case 1:
return $this->getPrjUid();
break;
case 2:
return $this->getMesName();
break;
case 3:
return $this->getMesCondition();
return $this->getMsgtName();
break;
default:
return null;
@@ -461,12 +417,11 @@ abstract class BaseMessage extends BaseObject implements Persistent
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = MessagePeer::getFieldNames($keyType);
$keys = MessageTypePeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getMesUid(),
$keys[0] => $this->getMsgtUid(),
$keys[1] => $this->getPrjUid(),
$keys[2] => $this->getMesName(),
$keys[3] => $this->getMesCondition(),
$keys[2] => $this->getMsgtName(),
);
return $result;
}
@@ -483,7 +438,7 @@ abstract class BaseMessage extends BaseObject implements Persistent
*/
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = MessagePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
$pos = MessageTypePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
@@ -499,16 +454,13 @@ abstract class BaseMessage extends BaseObject implements Persistent
{
switch($pos) {
case 0:
$this->setMesUid($value);
$this->setMsgtUid($value);
break;
case 1:
$this->setPrjUid($value);
break;
case 2:
$this->setMesName($value);
break;
case 3:
$this->setMesCondition($value);
$this->setMsgtName($value);
break;
} // switch()
}
@@ -531,10 +483,10 @@ abstract class BaseMessage extends BaseObject implements Persistent
*/
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = MessagePeer::getFieldNames($keyType);
$keys = MessageTypePeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) {
$this->setMesUid($arr[$keys[0]]);
$this->setMsgtUid($arr[$keys[0]]);
}
if (array_key_exists($keys[1], $arr)) {
@@ -542,11 +494,7 @@ abstract class BaseMessage extends BaseObject implements Persistent
}
if (array_key_exists($keys[2], $arr)) {
$this->setMesName($arr[$keys[2]]);
}
if (array_key_exists($keys[3], $arr)) {
$this->setMesCondition($arr[$keys[3]]);
$this->setMsgtName($arr[$keys[2]]);
}
}
@@ -558,22 +506,18 @@ abstract class BaseMessage extends BaseObject implements Persistent
*/
public function buildCriteria()
{
$criteria = new Criteria(MessagePeer::DATABASE_NAME);
$criteria = new Criteria(MessageTypePeer::DATABASE_NAME);
if ($this->isColumnModified(MessagePeer::MES_UID)) {
$criteria->add(MessagePeer::MES_UID, $this->mes_uid);
if ($this->isColumnModified(MessageTypePeer::MSGT_UID)) {
$criteria->add(MessageTypePeer::MSGT_UID, $this->msgt_uid);
}
if ($this->isColumnModified(MessagePeer::PRJ_UID)) {
$criteria->add(MessagePeer::PRJ_UID, $this->prj_uid);
if ($this->isColumnModified(MessageTypePeer::PRJ_UID)) {
$criteria->add(MessageTypePeer::PRJ_UID, $this->prj_uid);
}
if ($this->isColumnModified(MessagePeer::MES_NAME)) {
$criteria->add(MessagePeer::MES_NAME, $this->mes_name);
}
if ($this->isColumnModified(MessagePeer::MES_CONDITION)) {
$criteria->add(MessagePeer::MES_CONDITION, $this->mes_condition);
if ($this->isColumnModified(MessageTypePeer::MSGT_NAME)) {
$criteria->add(MessageTypePeer::MSGT_NAME, $this->msgt_name);
}
@@ -590,9 +534,9 @@ abstract class BaseMessage extends BaseObject implements Persistent
*/
public function buildPkeyCriteria()
{
$criteria = new Criteria(MessagePeer::DATABASE_NAME);
$criteria = new Criteria(MessageTypePeer::DATABASE_NAME);
$criteria->add(MessagePeer::MES_UID, $this->mes_uid);
$criteria->add(MessageTypePeer::MSGT_UID, $this->msgt_uid);
return $criteria;
}
@@ -603,18 +547,18 @@ abstract class BaseMessage extends BaseObject implements Persistent
*/
public function getPrimaryKey()
{
return $this->getMesUid();
return $this->getMsgtUid();
}
/**
* Generic method to set the primary key (mes_uid column).
* Generic method to set the primary key (msgt_uid column).
*
* @param string $key Primary key.
* @return void
*/
public function setPrimaryKey($key)
{
$this->setMesUid($key);
$this->setMsgtUid($key);
}
/**
@@ -623,7 +567,7 @@ abstract class BaseMessage extends BaseObject implements Persistent
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param object $copyObj An object of Message (or compatible) type.
* @param object $copyObj An object of MessageType (or compatible) type.
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @throws PropelException
*/
@@ -632,14 +576,12 @@ abstract class BaseMessage extends BaseObject implements Persistent
$copyObj->setPrjUid($this->prj_uid);
$copyObj->setMesName($this->mes_name);
$copyObj->setMesCondition($this->mes_condition);
$copyObj->setMsgtName($this->msgt_name);
$copyObj->setNew(true);
$copyObj->setMesUid(NULL); // this is a pkey column, so set to default value
$copyObj->setMsgtUid(NULL); // this is a pkey column, so set to default value
}
@@ -652,7 +594,7 @@ abstract class BaseMessage extends BaseObject implements Persistent
* objects.
*
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @return Message Clone of current object.
* @return MessageType Clone of current object.
* @throws PropelException
*/
public function copy($deepCopy = false)
@@ -671,12 +613,12 @@ abstract class BaseMessage extends BaseObject implements Persistent
* same instance for all member of this class. The method could therefore
* be static, but this would prevent one from overriding the behavior.
*
* @return MessagePeer
* @return MessageTypePeer
*/
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new MessagePeer();
self::$peer = new MessageTypePeer();
}
return self::$peer;
}

View File

@@ -2,46 +2,43 @@
require_once 'propel/util/BasePeer.php';
// The object class -- needed for instanceof checks in this class.
// actual class may be a subclass -- as returned by MessagePeer::getOMClass()
include_once 'classes/model/Message.php';
// actual class may be a subclass -- as returned by MessageTypePeer::getOMClass()
include_once 'classes/model/MessageType.php';
/**
* Base static class for performing query and update operations on the 'MESSAGE' table.
* Base static class for performing query and update operations on the 'MESSAGE_TYPE' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BaseMessagePeer
abstract class BaseMessageTypePeer
{
/** the default database name for this class */
const DATABASE_NAME = 'workflow';
/** the table name for this class */
const TABLE_NAME = 'MESSAGE';
const TABLE_NAME = 'MESSAGE_TYPE';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'classes.model.Message';
const CLASS_DEFAULT = 'classes.model.MessageType';
/** The total number of columns. */
const NUM_COLUMNS = 4;
const NUM_COLUMNS = 3;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the MES_UID field */
const MES_UID = 'MESSAGE.MES_UID';
/** the column name for the MSGT_UID field */
const MSGT_UID = 'MESSAGE_TYPE.MSGT_UID';
/** the column name for the PRJ_UID field */
const PRJ_UID = 'MESSAGE.PRJ_UID';
const PRJ_UID = 'MESSAGE_TYPE.PRJ_UID';
/** the column name for the MES_NAME field */
const MES_NAME = 'MESSAGE.MES_NAME';
/** the column name for the MES_CONDITION field */
const MES_CONDITION = 'MESSAGE.MES_CONDITION';
/** the column name for the MSGT_NAME field */
const MSGT_NAME = 'MESSAGE_TYPE.MSGT_NAME';
/** The PHP to DB Name Mapping */
private static $phpNameMap = null;
@@ -54,10 +51,10 @@ abstract class BaseMessagePeer
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('MesUid', 'PrjUid', 'MesName', 'MesCondition', ),
BasePeer::TYPE_COLNAME => array (MessagePeer::MES_UID, MessagePeer::PRJ_UID, MessagePeer::MES_NAME, MessagePeer::MES_CONDITION, ),
BasePeer::TYPE_FIELDNAME => array ('MES_UID', 'PRJ_UID', 'MES_NAME', 'MES_CONDITION', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
BasePeer::TYPE_PHPNAME => array ('MsgtUid', 'PrjUid', 'MsgtName', ),
BasePeer::TYPE_COLNAME => array (MessageTypePeer::MSGT_UID, MessageTypePeer::PRJ_UID, MessageTypePeer::MSGT_NAME, ),
BasePeer::TYPE_FIELDNAME => array ('MSGT_UID', 'PRJ_UID', 'MSGT_NAME', ),
BasePeer::TYPE_NUM => array (0, 1, 2, )
);
/**
@@ -67,10 +64,10 @@ abstract class BaseMessagePeer
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('MesUid' => 0, 'PrjUid' => 1, 'MesName' => 2, 'MesCondition' => 3, ),
BasePeer::TYPE_COLNAME => array (MessagePeer::MES_UID => 0, MessagePeer::PRJ_UID => 1, MessagePeer::MES_NAME => 2, MessagePeer::MES_CONDITION => 3, ),
BasePeer::TYPE_FIELDNAME => array ('MES_UID' => 0, 'PRJ_UID' => 1, 'MES_NAME' => 2, 'MES_CONDITION' => 3, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
BasePeer::TYPE_PHPNAME => array ('MsgtUid' => 0, 'PrjUid' => 1, 'MsgtName' => 2, ),
BasePeer::TYPE_COLNAME => array (MessageTypePeer::MSGT_UID => 0, MessageTypePeer::PRJ_UID => 1, MessageTypePeer::MSGT_NAME => 2, ),
BasePeer::TYPE_FIELDNAME => array ('MSGT_UID' => 0, 'PRJ_UID' => 1, 'MSGT_NAME' => 2, ),
BasePeer::TYPE_NUM => array (0, 1, 2, )
);
/**
@@ -80,8 +77,8 @@ abstract class BaseMessagePeer
*/
public static function getMapBuilder()
{
include_once 'classes/model/map/MessageMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.MessageMapBuilder');
include_once 'classes/model/map/MessageTypeMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.MessageTypeMapBuilder');
}
/**
* Gets a map (hash) of PHP names to DB column names.
@@ -94,7 +91,7 @@ abstract class BaseMessagePeer
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = MessagePeer::getTableMap();
$map = MessageTypePeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
@@ -149,12 +146,12 @@ abstract class BaseMessagePeer
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
* </code>
* @param string $alias The alias for the current table.
* @param string $column The column name for current table. (i.e. MessagePeer::COLUMN_NAME).
* @param string $column The column name for current table. (i.e. MessageTypePeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(MessagePeer::TABLE_NAME.'.', $alias.'.', $column);
return str_replace(MessageTypePeer::TABLE_NAME.'.', $alias.'.', $column);
}
/**
@@ -171,18 +168,16 @@ abstract class BaseMessagePeer
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(MessagePeer::MES_UID);
$criteria->addSelectColumn(MessageTypePeer::MSGT_UID);
$criteria->addSelectColumn(MessagePeer::PRJ_UID);
$criteria->addSelectColumn(MessageTypePeer::PRJ_UID);
$criteria->addSelectColumn(MessagePeer::MES_NAME);
$criteria->addSelectColumn(MessagePeer::MES_CONDITION);
$criteria->addSelectColumn(MessageTypePeer::MSGT_NAME);
}
const COUNT = 'COUNT(MESSAGE.MES_UID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT MESSAGE.MES_UID)';
const COUNT = 'COUNT(MESSAGE_TYPE.MSGT_UID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT MESSAGE_TYPE.MSGT_UID)';
/**
* Returns the number of rows matching criteria.
@@ -200,9 +195,9 @@ abstract class BaseMessagePeer
// clear out anything that might confuse the ORDER BY clause
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(MessagePeer::COUNT_DISTINCT);
$criteria->addSelectColumn(MessageTypePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(MessagePeer::COUNT);
$criteria->addSelectColumn(MessageTypePeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
@@ -210,7 +205,7 @@ abstract class BaseMessagePeer
$criteria->addSelectColumn($column);
}
$rs = MessagePeer::doSelectRS($criteria, $con);
$rs = MessageTypePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
@@ -223,7 +218,7 @@ abstract class BaseMessagePeer
*
* @param Criteria $criteria object used to create the SELECT statement.
* @param Connection $con
* @return Message
* @return MessageType
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
@@ -231,7 +226,7 @@ abstract class BaseMessagePeer
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = MessagePeer::doSelect($critcopy, $con);
$objects = MessageTypePeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
@@ -248,7 +243,7 @@ abstract class BaseMessagePeer
*/
public static function doSelect(Criteria $criteria, $con = null)
{
return MessagePeer::populateObjects(MessagePeer::doSelectRS($criteria, $con));
return MessageTypePeer::populateObjects(MessageTypePeer::doSelectRS($criteria, $con));
}
/**
* Prepares the Criteria object and uses the parent doSelect()
@@ -272,7 +267,7 @@ abstract class BaseMessagePeer
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
MessagePeer::addSelectColumns($criteria);
MessageTypePeer::addSelectColumns($criteria);
}
// Set the correct dbName
@@ -294,7 +289,7 @@ abstract class BaseMessagePeer
$results = array();
// set the class once to avoid overhead in the loop
$cls = MessagePeer::getOMClass();
$cls = MessageTypePeer::getOMClass();
$cls = Propel::import($cls);
// populate the object(s)
while ($rs->next()) {
@@ -329,13 +324,13 @@ abstract class BaseMessagePeer
*/
public static function getOMClass()
{
return MessagePeer::CLASS_DEFAULT;
return MessageTypePeer::CLASS_DEFAULT;
}
/**
* Method perform an INSERT on the database, given a Message or Criteria object.
* Method perform an INSERT on the database, given a MessageType or Criteria object.
*
* @param mixed $values Criteria or Message object containing data that is used to create the INSERT statement.
* @param mixed $values Criteria or MessageType 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
@@ -350,7 +345,7 @@ abstract class BaseMessagePeer
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from Message object
$criteria = $values->buildCriteria(); // build Criteria from MessageType object
}
@@ -372,9 +367,9 @@ abstract class BaseMessagePeer
}
/**
* Method perform an UPDATE on the database, given a Message or Criteria object.
* Method perform an UPDATE on the database, given a MessageType or Criteria object.
*
* @param mixed $values Criteria or Message object containing data create the UPDATE statement.
* @param mixed $values Criteria or MessageType 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
@@ -391,8 +386,8 @@ abstract class BaseMessagePeer
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(MessagePeer::MES_UID);
$selectCriteria->add(MessagePeer::MES_UID, $criteria->remove(MessagePeer::MES_UID), $comparison);
$comparison = $criteria->getComparison(MessageTypePeer::MSGT_UID);
$selectCriteria->add(MessageTypePeer::MSGT_UID, $criteria->remove(MessageTypePeer::MSGT_UID), $comparison);
} else {
$criteria = $values->buildCriteria(); // gets full criteria
@@ -406,7 +401,7 @@ abstract class BaseMessagePeer
}
/**
* Method to DELETE all rows from the MESSAGE table.
* Method to DELETE all rows from the MESSAGE_TYPE table.
*
* @return int The number of affected rows (if supported by underlying database driver).
*/
@@ -420,7 +415,7 @@ abstract class BaseMessagePeer
// 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(MessagePeer::TABLE_NAME, $con);
$affectedRows += BasePeer::doDeleteAll(MessageTypePeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
@@ -430,9 +425,9 @@ abstract class BaseMessagePeer
}
/**
* Method perform a DELETE on the database, given a Message or Criteria object OR a primary key value.
* Method perform a DELETE on the database, given a MessageType or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or Message object or primary key or array of primary keys
* @param mixed $values Criteria or MessageType 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).
@@ -444,18 +439,18 @@ abstract class BaseMessagePeer
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(MessagePeer::DATABASE_NAME);
$con = Propel::getConnection(MessageTypePeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} elseif ($values instanceof Message) {
} elseif ($values instanceof MessageType) {
$criteria = $values->buildPkeyCriteria();
} else {
// it must be the primary key
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(MessagePeer::MES_UID, (array) $values, Criteria::IN);
$criteria->add(MessageTypePeer::MSGT_UID, (array) $values, Criteria::IN);
}
// Set the correct dbName
@@ -478,24 +473,24 @@ abstract class BaseMessagePeer
}
/**
* Validates all modified columns of given Message object.
* Validates all modified columns of given MessageType 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 Message $obj The object to validate.
* @param MessageType $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(Message $obj, $cols = null)
public static function doValidate(MessageType $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(MessagePeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(MessagePeer::TABLE_NAME);
$dbMap = Propel::getDatabaseMap(MessageTypePeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(MessageTypePeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
@@ -511,7 +506,7 @@ abstract class BaseMessagePeer
}
return BasePeer::doValidate(MessagePeer::DATABASE_NAME, MessagePeer::TABLE_NAME, $columns);
return BasePeer::doValidate(MessageTypePeer::DATABASE_NAME, MessageTypePeer::TABLE_NAME, $columns);
}
/**
@@ -519,7 +514,7 @@ abstract class BaseMessagePeer
*
* @param mixed $pk the primary key.
* @param Connection $con the connection to use
* @return Message
* @return MessageType
*/
public static function retrieveByPK($pk, $con = null)
{
@@ -527,12 +522,12 @@ abstract class BaseMessagePeer
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(MessagePeer::DATABASE_NAME);
$criteria = new Criteria(MessageTypePeer::DATABASE_NAME);
$criteria->add(MessagePeer::MES_UID, $pk);
$criteria->add(MessageTypePeer::MSGT_UID, $pk);
$v = MessagePeer::doSelect($criteria, $con);
$v = MessageTypePeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
@@ -556,8 +551,8 @@ abstract class BaseMessagePeer
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(MessagePeer::MES_UID, $pks, Criteria::IN);
$objs = MessagePeer::doSelect($criteria, $con);
$criteria->add(MessageTypePeer::MSGT_UID, $pks, Criteria::IN);
$objs = MessageTypePeer::doSelect($criteria, $con);
}
return $objs;
}
@@ -569,14 +564,14 @@ if (Propel::isInit()) {
// the MapBuilder classes register themselves with Propel during initialization
// so we need to load them here.
try {
BaseMessagePeer::getMapBuilder();
BaseMessageTypePeer::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/MessageMapBuilder.php';
Propel::registerMapBuilder('classes.model.map.MessageMapBuilder');
require_once 'classes/model/map/MessageTypeMapBuilder.php';
Propel::registerMapBuilder('classes.model.map.MessageTypeMapBuilder');
}

View File

@@ -7,49 +7,49 @@ require_once 'propel/om/Persistent.php';
include_once 'propel/util/Criteria.php';
include_once 'classes/model/MessageDetailPeer.php';
include_once 'classes/model/MessageTypeVariablePeer.php';
/**
* Base class that represents a row from the 'MESSAGE_DETAIL' table.
* Base class that represents a row from the 'MESSAGE_TYPE_VARIABLE' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BaseMessageDetail extends BaseObject implements Persistent
abstract class BaseMessageTypeVariable 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 MessageDetailPeer
* @var MessageTypeVariablePeer
*/
protected static $peer;
/**
* The value for the md_uid field.
* The value for the msgtv_uid field.
* @var string
*/
protected $md_uid;
protected $msgtv_uid;
/**
* The value for the mes_uid field.
* The value for the msgt_uid field.
* @var string
*/
protected $mes_uid;
protected $msgt_uid;
/**
* The value for the md_type field.
* The value for the msgtv_name field.
* @var string
*/
protected $md_type = '';
protected $msgtv_name = '';
/**
* The value for the md_name field.
* The value for the msgtv_default_value field.
* @var string
*/
protected $md_name = '';
protected $msgtv_default_value = '';
/**
* Flag to prevent endless save loop, if this object is referenced
@@ -66,56 +66,56 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
protected $alreadyInValidation = false;
/**
* Get the [md_uid] column value.
* Get the [msgtv_uid] column value.
*
* @return string
*/
public function getMdUid()
public function getMsgtvUid()
{
return $this->md_uid;
return $this->msgtv_uid;
}
/**
* Get the [mes_uid] column value.
* Get the [msgt_uid] column value.
*
* @return string
*/
public function getMesUid()
public function getMsgtUid()
{
return $this->mes_uid;
return $this->msgt_uid;
}
/**
* Get the [md_type] column value.
* Get the [msgtv_name] column value.
*
* @return string
*/
public function getMdType()
public function getMsgtvName()
{
return $this->md_type;
return $this->msgtv_name;
}
/**
* Get the [md_name] column value.
* Get the [msgtv_default_value] column value.
*
* @return string
*/
public function getMdName()
public function getMsgtvDefaultValue()
{
return $this->md_name;
return $this->msgtv_default_value;
}
/**
* Set the value of [md_uid] column.
* Set the value of [msgtv_uid] column.
*
* @param string $v new value
* @return void
*/
public function setMdUid($v)
public function setMsgtvUid($v)
{
// Since the native PHP type for this column is string,
@@ -124,20 +124,20 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
$v = (string) $v;
}
if ($this->md_uid !== $v) {
$this->md_uid = $v;
$this->modifiedColumns[] = MessageDetailPeer::MD_UID;
if ($this->msgtv_uid !== $v) {
$this->msgtv_uid = $v;
$this->modifiedColumns[] = MessageTypeVariablePeer::MSGTV_UID;
}
} // setMdUid()
} // setMsgtvUid()
/**
* Set the value of [mes_uid] column.
* Set the value of [msgt_uid] column.
*
* @param string $v new value
* @return void
*/
public function setMesUid($v)
public function setMsgtUid($v)
{
// Since the native PHP type for this column is string,
@@ -146,20 +146,20 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
$v = (string) $v;
}
if ($this->mes_uid !== $v) {
$this->mes_uid = $v;
$this->modifiedColumns[] = MessageDetailPeer::MES_UID;
if ($this->msgt_uid !== $v) {
$this->msgt_uid = $v;
$this->modifiedColumns[] = MessageTypeVariablePeer::MSGT_UID;
}
} // setMesUid()
} // setMsgtUid()
/**
* Set the value of [md_type] column.
* Set the value of [msgtv_name] column.
*
* @param string $v new value
* @return void
*/
public function setMdType($v)
public function setMsgtvName($v)
{
// Since the native PHP type for this column is string,
@@ -168,20 +168,20 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
$v = (string) $v;
}
if ($this->md_type !== $v || $v === '') {
$this->md_type = $v;
$this->modifiedColumns[] = MessageDetailPeer::MD_TYPE;
if ($this->msgtv_name !== $v || $v === '') {
$this->msgtv_name = $v;
$this->modifiedColumns[] = MessageTypeVariablePeer::MSGTV_NAME;
}
} // setMdType()
} // setMsgtvName()
/**
* Set the value of [md_name] column.
* Set the value of [msgtv_default_value] column.
*
* @param string $v new value
* @return void
*/
public function setMdName($v)
public function setMsgtvDefaultValue($v)
{
// Since the native PHP type for this column is string,
@@ -190,12 +190,12 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
$v = (string) $v;
}
if ($this->md_name !== $v || $v === '') {
$this->md_name = $v;
$this->modifiedColumns[] = MessageDetailPeer::MD_NAME;
if ($this->msgtv_default_value !== $v || $v === '') {
$this->msgtv_default_value = $v;
$this->modifiedColumns[] = MessageTypeVariablePeer::MSGTV_DEFAULT_VALUE;
}
} // setMdName()
} // setMsgtvDefaultValue()
/**
* Hydrates (populates) the object variables with values from the database resultset.
@@ -214,23 +214,23 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
{
try {
$this->md_uid = $rs->getString($startcol + 0);
$this->msgtv_uid = $rs->getString($startcol + 0);
$this->mes_uid = $rs->getString($startcol + 1);
$this->msgt_uid = $rs->getString($startcol + 1);
$this->md_type = $rs->getString($startcol + 2);
$this->msgtv_name = $rs->getString($startcol + 2);
$this->md_name = $rs->getString($startcol + 3);
$this->msgtv_default_value = $rs->getString($startcol + 3);
$this->resetModified();
$this->setNew(false);
// FIXME - using NUM_COLUMNS may be clearer.
return $startcol + 4; // 4 = MessageDetailPeer::NUM_COLUMNS - MessageDetailPeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 4; // 4 = MessageTypeVariablePeer::NUM_COLUMNS - MessageTypeVariablePeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating MessageDetail object", $e);
throw new PropelException("Error populating MessageTypeVariable object", $e);
}
}
@@ -250,12 +250,12 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
}
if ($con === null) {
$con = Propel::getConnection(MessageDetailPeer::DATABASE_NAME);
$con = Propel::getConnection(MessageTypeVariablePeer::DATABASE_NAME);
}
try {
$con->begin();
MessageDetailPeer::doDelete($this, $con);
MessageTypeVariablePeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
@@ -281,7 +281,7 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
}
if ($con === null) {
$con = Propel::getConnection(MessageDetailPeer::DATABASE_NAME);
$con = Propel::getConnection(MessageTypeVariablePeer::DATABASE_NAME);
}
try {
@@ -316,14 +316,14 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
// If this object has been modified, then save it to the database.
if ($this->isModified()) {
if ($this->isNew()) {
$pk = MessageDetailPeer::doInsert($this, $con);
$pk = MessageTypeVariablePeer::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 += MessageDetailPeer::doUpdate($this, $con);
$affectedRows += MessageTypeVariablePeer::doUpdate($this, $con);
}
$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
}
@@ -394,7 +394,7 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
$failureMap = array();
if (($retval = MessageDetailPeer::doValidate($this, $columns)) !== true) {
if (($retval = MessageTypeVariablePeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
@@ -417,7 +417,7 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
*/
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = MessageDetailPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
$pos = MessageTypeVariablePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
@@ -432,16 +432,16 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
{
switch($pos) {
case 0:
return $this->getMdUid();
return $this->getMsgtvUid();
break;
case 1:
return $this->getMesUid();
return $this->getMsgtUid();
break;
case 2:
return $this->getMdType();
return $this->getMsgtvName();
break;
case 3:
return $this->getMdName();
return $this->getMsgtvDefaultValue();
break;
default:
return null;
@@ -461,12 +461,12 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = MessageDetailPeer::getFieldNames($keyType);
$keys = MessageTypeVariablePeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getMdUid(),
$keys[1] => $this->getMesUid(),
$keys[2] => $this->getMdType(),
$keys[3] => $this->getMdName(),
$keys[0] => $this->getMsgtvUid(),
$keys[1] => $this->getMsgtUid(),
$keys[2] => $this->getMsgtvName(),
$keys[3] => $this->getMsgtvDefaultValue(),
);
return $result;
}
@@ -483,7 +483,7 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
*/
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = MessageDetailPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
$pos = MessageTypeVariablePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
@@ -499,16 +499,16 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
{
switch($pos) {
case 0:
$this->setMdUid($value);
$this->setMsgtvUid($value);
break;
case 1:
$this->setMesUid($value);
$this->setMsgtUid($value);
break;
case 2:
$this->setMdType($value);
$this->setMsgtvName($value);
break;
case 3:
$this->setMdName($value);
$this->setMsgtvDefaultValue($value);
break;
} // switch()
}
@@ -531,22 +531,22 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
*/
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = MessageDetailPeer::getFieldNames($keyType);
$keys = MessageTypeVariablePeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) {
$this->setMdUid($arr[$keys[0]]);
$this->setMsgtvUid($arr[$keys[0]]);
}
if (array_key_exists($keys[1], $arr)) {
$this->setMesUid($arr[$keys[1]]);
$this->setMsgtUid($arr[$keys[1]]);
}
if (array_key_exists($keys[2], $arr)) {
$this->setMdType($arr[$keys[2]]);
$this->setMsgtvName($arr[$keys[2]]);
}
if (array_key_exists($keys[3], $arr)) {
$this->setMdName($arr[$keys[3]]);
$this->setMsgtvDefaultValue($arr[$keys[3]]);
}
}
@@ -558,22 +558,22 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
*/
public function buildCriteria()
{
$criteria = new Criteria(MessageDetailPeer::DATABASE_NAME);
$criteria = new Criteria(MessageTypeVariablePeer::DATABASE_NAME);
if ($this->isColumnModified(MessageDetailPeer::MD_UID)) {
$criteria->add(MessageDetailPeer::MD_UID, $this->md_uid);
if ($this->isColumnModified(MessageTypeVariablePeer::MSGTV_UID)) {
$criteria->add(MessageTypeVariablePeer::MSGTV_UID, $this->msgtv_uid);
}
if ($this->isColumnModified(MessageDetailPeer::MES_UID)) {
$criteria->add(MessageDetailPeer::MES_UID, $this->mes_uid);
if ($this->isColumnModified(MessageTypeVariablePeer::MSGT_UID)) {
$criteria->add(MessageTypeVariablePeer::MSGT_UID, $this->msgt_uid);
}
if ($this->isColumnModified(MessageDetailPeer::MD_TYPE)) {
$criteria->add(MessageDetailPeer::MD_TYPE, $this->md_type);
if ($this->isColumnModified(MessageTypeVariablePeer::MSGTV_NAME)) {
$criteria->add(MessageTypeVariablePeer::MSGTV_NAME, $this->msgtv_name);
}
if ($this->isColumnModified(MessageDetailPeer::MD_NAME)) {
$criteria->add(MessageDetailPeer::MD_NAME, $this->md_name);
if ($this->isColumnModified(MessageTypeVariablePeer::MSGTV_DEFAULT_VALUE)) {
$criteria->add(MessageTypeVariablePeer::MSGTV_DEFAULT_VALUE, $this->msgtv_default_value);
}
@@ -590,9 +590,9 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
*/
public function buildPkeyCriteria()
{
$criteria = new Criteria(MessageDetailPeer::DATABASE_NAME);
$criteria = new Criteria(MessageTypeVariablePeer::DATABASE_NAME);
$criteria->add(MessageDetailPeer::MD_UID, $this->md_uid);
$criteria->add(MessageTypeVariablePeer::MSGTV_UID, $this->msgtv_uid);
return $criteria;
}
@@ -603,18 +603,18 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
*/
public function getPrimaryKey()
{
return $this->getMdUid();
return $this->getMsgtvUid();
}
/**
* Generic method to set the primary key (md_uid column).
* Generic method to set the primary key (msgtv_uid column).
*
* @param string $key Primary key.
* @return void
*/
public function setPrimaryKey($key)
{
$this->setMdUid($key);
$this->setMsgtvUid($key);
}
/**
@@ -623,23 +623,23 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param object $copyObj An object of MessageDetail (or compatible) type.
* @param object $copyObj An object of MessageTypeVariable (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->setMesUid($this->mes_uid);
$copyObj->setMsgtUid($this->msgt_uid);
$copyObj->setMdType($this->md_type);
$copyObj->setMsgtvName($this->msgtv_name);
$copyObj->setMdName($this->md_name);
$copyObj->setMsgtvDefaultValue($this->msgtv_default_value);
$copyObj->setNew(true);
$copyObj->setMdUid(NULL); // this is a pkey column, so set to default value
$copyObj->setMsgtvUid(NULL); // this is a pkey column, so set to default value
}
@@ -652,7 +652,7 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
* objects.
*
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @return MessageDetail Clone of current object.
* @return MessageTypeVariable Clone of current object.
* @throws PropelException
*/
public function copy($deepCopy = false)
@@ -671,12 +671,12 @@ abstract class BaseMessageDetail extends BaseObject implements Persistent
* same instance for all member of this class. The method could therefore
* be static, but this would prevent one from overriding the behavior.
*
* @return MessageDetailPeer
* @return MessageTypeVariablePeer
*/
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new MessageDetailPeer();
self::$peer = new MessageTypeVariablePeer();
}
return self::$peer;
}

View File

@@ -2,27 +2,27 @@
require_once 'propel/util/BasePeer.php';
// The object class -- needed for instanceof checks in this class.
// actual class may be a subclass -- as returned by MessageDetailPeer::getOMClass()
include_once 'classes/model/MessageDetail.php';
// actual class may be a subclass -- as returned by MessageTypeVariablePeer::getOMClass()
include_once 'classes/model/MessageTypeVariable.php';
/**
* Base static class for performing query and update operations on the 'MESSAGE_DETAIL' table.
* Base static class for performing query and update operations on the 'MESSAGE_TYPE_VARIABLE' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BaseMessageDetailPeer
abstract class BaseMessageTypeVariablePeer
{
/** the default database name for this class */
const DATABASE_NAME = 'workflow';
/** the table name for this class */
const TABLE_NAME = 'MESSAGE_DETAIL';
const TABLE_NAME = 'MESSAGE_TYPE_VARIABLE';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'classes.model.MessageDetail';
const CLASS_DEFAULT = 'classes.model.MessageTypeVariable';
/** The total number of columns. */
const NUM_COLUMNS = 4;
@@ -31,17 +31,17 @@ abstract class BaseMessageDetailPeer
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the MD_UID field */
const MD_UID = 'MESSAGE_DETAIL.MD_UID';
/** the column name for the MSGTV_UID field */
const MSGTV_UID = 'MESSAGE_TYPE_VARIABLE.MSGTV_UID';
/** the column name for the MES_UID field */
const MES_UID = 'MESSAGE_DETAIL.MES_UID';
/** the column name for the MSGT_UID field */
const MSGT_UID = 'MESSAGE_TYPE_VARIABLE.MSGT_UID';
/** the column name for the MD_TYPE field */
const MD_TYPE = 'MESSAGE_DETAIL.MD_TYPE';
/** the column name for the MSGTV_NAME field */
const MSGTV_NAME = 'MESSAGE_TYPE_VARIABLE.MSGTV_NAME';
/** the column name for the MD_NAME field */
const MD_NAME = 'MESSAGE_DETAIL.MD_NAME';
/** the column name for the MSGTV_DEFAULT_VALUE field */
const MSGTV_DEFAULT_VALUE = 'MESSAGE_TYPE_VARIABLE.MSGTV_DEFAULT_VALUE';
/** The PHP to DB Name Mapping */
private static $phpNameMap = null;
@@ -54,9 +54,9 @@ abstract class BaseMessageDetailPeer
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('MdUid', 'MesUid', 'MdType', 'MdName', ),
BasePeer::TYPE_COLNAME => array (MessageDetailPeer::MD_UID, MessageDetailPeer::MES_UID, MessageDetailPeer::MD_TYPE, MessageDetailPeer::MD_NAME, ),
BasePeer::TYPE_FIELDNAME => array ('MD_UID', 'MES_UID', 'MD_TYPE', 'MD_NAME', ),
BasePeer::TYPE_PHPNAME => array ('MsgtvUid', 'MsgtUid', 'MsgtvName', 'MsgtvDefaultValue', ),
BasePeer::TYPE_COLNAME => array (MessageTypeVariablePeer::MSGTV_UID, MessageTypeVariablePeer::MSGT_UID, MessageTypeVariablePeer::MSGTV_NAME, MessageTypeVariablePeer::MSGTV_DEFAULT_VALUE, ),
BasePeer::TYPE_FIELDNAME => array ('MSGTV_UID', 'MSGT_UID', 'MSGTV_NAME', 'MSGTV_DEFAULT_VALUE', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
@@ -67,9 +67,9 @@ abstract class BaseMessageDetailPeer
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('MdUid' => 0, 'MesUid' => 1, 'MdType' => 2, 'MdName' => 3, ),
BasePeer::TYPE_COLNAME => array (MessageDetailPeer::MD_UID => 0, MessageDetailPeer::MES_UID => 1, MessageDetailPeer::MD_TYPE => 2, MessageDetailPeer::MD_NAME => 3, ),
BasePeer::TYPE_FIELDNAME => array ('MD_UID' => 0, 'MES_UID' => 1, 'MD_TYPE' => 2, 'MD_NAME' => 3, ),
BasePeer::TYPE_PHPNAME => array ('MsgtvUid' => 0, 'MsgtUid' => 1, 'MsgtvName' => 2, 'MsgtvDefaultValue' => 3, ),
BasePeer::TYPE_COLNAME => array (MessageTypeVariablePeer::MSGTV_UID => 0, MessageTypeVariablePeer::MSGT_UID => 1, MessageTypeVariablePeer::MSGTV_NAME => 2, MessageTypeVariablePeer::MSGTV_DEFAULT_VALUE => 3, ),
BasePeer::TYPE_FIELDNAME => array ('MSGTV_UID' => 0, 'MSGT_UID' => 1, 'MSGTV_NAME' => 2, 'MSGTV_DEFAULT_VALUE' => 3, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
@@ -80,8 +80,8 @@ abstract class BaseMessageDetailPeer
*/
public static function getMapBuilder()
{
include_once 'classes/model/map/MessageDetailMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.MessageDetailMapBuilder');
include_once 'classes/model/map/MessageTypeVariableMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.MessageTypeVariableMapBuilder');
}
/**
* Gets a map (hash) of PHP names to DB column names.
@@ -94,7 +94,7 @@ abstract class BaseMessageDetailPeer
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = MessageDetailPeer::getTableMap();
$map = MessageTypeVariablePeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
@@ -149,12 +149,12 @@ abstract class BaseMessageDetailPeer
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
* </code>
* @param string $alias The alias for the current table.
* @param string $column The column name for current table. (i.e. MessageDetailPeer::COLUMN_NAME).
* @param string $column The column name for current table. (i.e. MessageTypeVariablePeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(MessageDetailPeer::TABLE_NAME.'.', $alias.'.', $column);
return str_replace(MessageTypeVariablePeer::TABLE_NAME.'.', $alias.'.', $column);
}
/**
@@ -171,18 +171,18 @@ abstract class BaseMessageDetailPeer
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(MessageDetailPeer::MD_UID);
$criteria->addSelectColumn(MessageTypeVariablePeer::MSGTV_UID);
$criteria->addSelectColumn(MessageDetailPeer::MES_UID);
$criteria->addSelectColumn(MessageTypeVariablePeer::MSGT_UID);
$criteria->addSelectColumn(MessageDetailPeer::MD_TYPE);
$criteria->addSelectColumn(MessageTypeVariablePeer::MSGTV_NAME);
$criteria->addSelectColumn(MessageDetailPeer::MD_NAME);
$criteria->addSelectColumn(MessageTypeVariablePeer::MSGTV_DEFAULT_VALUE);
}
const COUNT = 'COUNT(MESSAGE_DETAIL.MD_UID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT MESSAGE_DETAIL.MD_UID)';
const COUNT = 'COUNT(MESSAGE_TYPE_VARIABLE.MSGTV_UID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT MESSAGE_TYPE_VARIABLE.MSGTV_UID)';
/**
* Returns the number of rows matching criteria.
@@ -200,9 +200,9 @@ abstract class BaseMessageDetailPeer
// clear out anything that might confuse the ORDER BY clause
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(MessageDetailPeer::COUNT_DISTINCT);
$criteria->addSelectColumn(MessageTypeVariablePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(MessageDetailPeer::COUNT);
$criteria->addSelectColumn(MessageTypeVariablePeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
@@ -210,7 +210,7 @@ abstract class BaseMessageDetailPeer
$criteria->addSelectColumn($column);
}
$rs = MessageDetailPeer::doSelectRS($criteria, $con);
$rs = MessageTypeVariablePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
@@ -223,7 +223,7 @@ abstract class BaseMessageDetailPeer
*
* @param Criteria $criteria object used to create the SELECT statement.
* @param Connection $con
* @return MessageDetail
* @return MessageTypeVariable
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
@@ -231,7 +231,7 @@ abstract class BaseMessageDetailPeer
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = MessageDetailPeer::doSelect($critcopy, $con);
$objects = MessageTypeVariablePeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
@@ -248,7 +248,7 @@ abstract class BaseMessageDetailPeer
*/
public static function doSelect(Criteria $criteria, $con = null)
{
return MessageDetailPeer::populateObjects(MessageDetailPeer::doSelectRS($criteria, $con));
return MessageTypeVariablePeer::populateObjects(MessageTypeVariablePeer::doSelectRS($criteria, $con));
}
/**
* Prepares the Criteria object and uses the parent doSelect()
@@ -272,7 +272,7 @@ abstract class BaseMessageDetailPeer
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
MessageDetailPeer::addSelectColumns($criteria);
MessageTypeVariablePeer::addSelectColumns($criteria);
}
// Set the correct dbName
@@ -294,7 +294,7 @@ abstract class BaseMessageDetailPeer
$results = array();
// set the class once to avoid overhead in the loop
$cls = MessageDetailPeer::getOMClass();
$cls = MessageTypeVariablePeer::getOMClass();
$cls = Propel::import($cls);
// populate the object(s)
while ($rs->next()) {
@@ -329,13 +329,13 @@ abstract class BaseMessageDetailPeer
*/
public static function getOMClass()
{
return MessageDetailPeer::CLASS_DEFAULT;
return MessageTypeVariablePeer::CLASS_DEFAULT;
}
/**
* Method perform an INSERT on the database, given a MessageDetail or Criteria object.
* Method perform an INSERT on the database, given a MessageTypeVariable or Criteria object.
*
* @param mixed $values Criteria or MessageDetail object containing data that is used to create the INSERT statement.
* @param mixed $values Criteria or MessageTypeVariable 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
@@ -350,7 +350,7 @@ abstract class BaseMessageDetailPeer
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from MessageDetail object
$criteria = $values->buildCriteria(); // build Criteria from MessageTypeVariable object
}
@@ -372,9 +372,9 @@ abstract class BaseMessageDetailPeer
}
/**
* Method perform an UPDATE on the database, given a MessageDetail or Criteria object.
* Method perform an UPDATE on the database, given a MessageTypeVariable or Criteria object.
*
* @param mixed $values Criteria or MessageDetail object containing data create the UPDATE statement.
* @param mixed $values Criteria or MessageTypeVariable 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
@@ -391,8 +391,8 @@ abstract class BaseMessageDetailPeer
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(MessageDetailPeer::MD_UID);
$selectCriteria->add(MessageDetailPeer::MD_UID, $criteria->remove(MessageDetailPeer::MD_UID), $comparison);
$comparison = $criteria->getComparison(MessageTypeVariablePeer::MSGTV_UID);
$selectCriteria->add(MessageTypeVariablePeer::MSGTV_UID, $criteria->remove(MessageTypeVariablePeer::MSGTV_UID), $comparison);
} else {
$criteria = $values->buildCriteria(); // gets full criteria
@@ -406,7 +406,7 @@ abstract class BaseMessageDetailPeer
}
/**
* Method to DELETE all rows from the MESSAGE_DETAIL table.
* Method to DELETE all rows from the MESSAGE_TYPE_VARIABLE table.
*
* @return int The number of affected rows (if supported by underlying database driver).
*/
@@ -420,7 +420,7 @@ abstract class BaseMessageDetailPeer
// 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(MessageDetailPeer::TABLE_NAME, $con);
$affectedRows += BasePeer::doDeleteAll(MessageTypeVariablePeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
@@ -430,9 +430,9 @@ abstract class BaseMessageDetailPeer
}
/**
* Method perform a DELETE on the database, given a MessageDetail or Criteria object OR a primary key value.
* Method perform a DELETE on the database, given a MessageTypeVariable or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or MessageDetail object or primary key or array of primary keys
* @param mixed $values Criteria or MessageTypeVariable 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).
@@ -444,18 +444,18 @@ abstract class BaseMessageDetailPeer
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(MessageDetailPeer::DATABASE_NAME);
$con = Propel::getConnection(MessageTypeVariablePeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} elseif ($values instanceof MessageDetail) {
} elseif ($values instanceof MessageTypeVariable) {
$criteria = $values->buildPkeyCriteria();
} else {
// it must be the primary key
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(MessageDetailPeer::MD_UID, (array) $values, Criteria::IN);
$criteria->add(MessageTypeVariablePeer::MSGTV_UID, (array) $values, Criteria::IN);
}
// Set the correct dbName
@@ -478,24 +478,24 @@ abstract class BaseMessageDetailPeer
}
/**
* Validates all modified columns of given MessageDetail object.
* Validates all modified columns of given MessageTypeVariable 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 MessageDetail $obj The object to validate.
* @param MessageTypeVariable $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(MessageDetail $obj, $cols = null)
public static function doValidate(MessageTypeVariable $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(MessageDetailPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(MessageDetailPeer::TABLE_NAME);
$dbMap = Propel::getDatabaseMap(MessageTypeVariablePeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(MessageTypeVariablePeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
@@ -511,7 +511,7 @@ abstract class BaseMessageDetailPeer
}
return BasePeer::doValidate(MessageDetailPeer::DATABASE_NAME, MessageDetailPeer::TABLE_NAME, $columns);
return BasePeer::doValidate(MessageTypeVariablePeer::DATABASE_NAME, MessageTypeVariablePeer::TABLE_NAME, $columns);
}
/**
@@ -519,7 +519,7 @@ abstract class BaseMessageDetailPeer
*
* @param mixed $pk the primary key.
* @param Connection $con the connection to use
* @return MessageDetail
* @return MessageTypeVariable
*/
public static function retrieveByPK($pk, $con = null)
{
@@ -527,12 +527,12 @@ abstract class BaseMessageDetailPeer
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(MessageDetailPeer::DATABASE_NAME);
$criteria = new Criteria(MessageTypeVariablePeer::DATABASE_NAME);
$criteria->add(MessageDetailPeer::MD_UID, $pk);
$criteria->add(MessageTypeVariablePeer::MSGTV_UID, $pk);
$v = MessageDetailPeer::doSelect($criteria, $con);
$v = MessageTypeVariablePeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
@@ -556,8 +556,8 @@ abstract class BaseMessageDetailPeer
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(MessageDetailPeer::MD_UID, $pks, Criteria::IN);
$objs = MessageDetailPeer::doSelect($criteria, $con);
$criteria->add(MessageTypeVariablePeer::MSGTV_UID, $pks, Criteria::IN);
$objs = MessageTypeVariablePeer::doSelect($criteria, $con);
}
return $objs;
}
@@ -569,14 +569,14 @@ if (Propel::isInit()) {
// the MapBuilder classes register themselves with Propel during initialization
// so we need to load them here.
try {
BaseMessageDetailPeer::getMapBuilder();
BaseMessageTypeVariablePeer::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/MessageDetailMapBuilder.php';
Propel::registerMapBuilder('classes.model.map.MessageDetailMapBuilder');
require_once 'classes/model/map/MessageTypeVariableMapBuilder.php';
Propel::registerMapBuilder('classes.model.map.MessageTypeVariableMapBuilder');
}