Added new column in Gateway Table 'GAT_TYPE'

This commit is contained in:
girish
2011-02-12 11:35:27 +00:00
parent 5b6647de1c
commit 4197a757f5
5 changed files with 88 additions and 17 deletions

View File

@@ -76,6 +76,8 @@ class GatewayMapBuilder {
$tMap->addColumn('GAT_Y', 'GatY', 'int', CreoleTypes::INTEGER, true, null);
$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', 'required', 'propel.validator.RequiredValidator', '', 'Gateway Element UID is required.');

View File

@@ -69,6 +69,13 @@ abstract class BaseGateway extends BaseObject implements Persistent {
*/
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.
@@ -149,6 +156,17 @@ abstract class BaseGateway extends BaseObject implements Persistent {
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.
*
@@ -281,6 +299,28 @@ abstract class BaseGateway extends BaseObject implements Persistent {
} // 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.
*
@@ -310,12 +350,14 @@ abstract class BaseGateway extends BaseObject implements Persistent {
$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 + 6; // 6 = GatewayPeer::NUM_COLUMNS - GatewayPeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 7; // 7 = GatewayPeer::NUM_COLUMNS - GatewayPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating Gateway object", $e);
@@ -536,6 +578,9 @@ abstract class BaseGateway extends BaseObject implements Persistent {
case 5:
return $this->getGatY();
break;
case 6:
return $this->getGatType();
break;
default:
return null;
break;
@@ -562,6 +607,7 @@ abstract class BaseGateway extends BaseObject implements Persistent {
$keys[3] => $this->getGatNextTask(),
$keys[4] => $this->getGatX(),
$keys[5] => $this->getGatY(),
$keys[6] => $this->getGatType(),
);
return $result;
}
@@ -611,6 +657,9 @@ abstract class BaseGateway extends BaseObject implements Persistent {
case 5:
$this->setGatY($value);
break;
case 6:
$this->setGatType($value);
break;
} // switch()
}
@@ -640,6 +689,7 @@ abstract class BaseGateway extends BaseObject implements Persistent {
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]]);
}
/**
@@ -657,6 +707,7 @@ abstract class BaseGateway extends BaseObject implements Persistent {
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;
}
@@ -721,6 +772,8 @@ abstract class BaseGateway extends BaseObject implements Persistent {
$copyObj->setGatY($this->gat_y);
$copyObj->setGatType($this->gat_type);
$copyObj->setNew(true);

View File

@@ -24,7 +24,7 @@ abstract class BaseGatewayPeer {
const CLASS_DEFAULT = 'classes.model.Gateway';
/** The total number of columns. */
const NUM_COLUMNS = 6;
const NUM_COLUMNS = 7;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
@@ -48,6 +48,9 @@ abstract class BaseGatewayPeer {
/** 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;
@@ -59,10 +62,10 @@ abstract class BaseGatewayPeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('GatUid', 'ProUid', 'TasUid', 'GatNextTask', 'GatX', 'GatY', ),
BasePeer::TYPE_COLNAME => array (GatewayPeer::GAT_UID, GatewayPeer::PRO_UID, GatewayPeer::TAS_UID, GatewayPeer::GAT_NEXT_TASK, GatewayPeer::GAT_X, GatewayPeer::GAT_Y, ),
BasePeer::TYPE_FIELDNAME => array ('GAT_UID', 'PRO_UID', 'TAS_UID', 'GAT_NEXT_TASK', 'GAT_X', 'GAT_Y', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
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, )
);
/**
@@ -72,10 +75,10 @@ abstract class BaseGatewayPeer {
* 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, ),
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, ),
BasePeer::TYPE_FIELDNAME => array ('GAT_UID' => 0, 'PRO_UID' => 1, 'TAS_UID' => 2, 'GAT_NEXT_TASK' => 3, 'GAT_X' => 4, 'GAT_Y' => 5, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
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, )
);
/**
@@ -188,6 +191,8 @@ abstract class BaseGatewayPeer {
$criteria->addSelectColumn(GatewayPeer::GAT_Y);
$criteria->addSelectColumn(GatewayPeer::GAT_TYPE);
}
const COUNT = 'COUNT(GATEWAY.GAT_UID)';