From cedc5bbae5164c93c156ab4800a20f3a9d687b5a Mon Sep 17 00:00:00 2001 From: Andrea Adamczyk Date: Fri, 8 Nov 2019 09:48:59 -0400 Subject: [PATCH] PMC-1367 --- .../model/map/AppSequenceMapBuilder.php | 2 + .../classes/model/om/BaseAppSequence.php | 60 ++++++++++++++++++- .../classes/model/om/BaseAppSequencePeer.php | 23 ++++--- workflow/engine/config/schema.xml | 1 + workflow/engine/data/mysql/schema.sql | 1 + 5 files changed, 77 insertions(+), 10 deletions(-) diff --git a/workflow/engine/classes/model/map/AppSequenceMapBuilder.php b/workflow/engine/classes/model/map/AppSequenceMapBuilder.php index 85e86b876..2df087efc 100644 --- a/workflow/engine/classes/model/map/AppSequenceMapBuilder.php +++ b/workflow/engine/classes/model/map/AppSequenceMapBuilder.php @@ -67,6 +67,8 @@ class AppSequenceMapBuilder $tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null); + $tMap->addColumn('APP_TYPE', 'AppType', 'string', CreoleTypes::VARCHAR, true, 20); + } // doBuild() } // AppSequenceMapBuilder diff --git a/workflow/engine/classes/model/om/BaseAppSequence.php b/workflow/engine/classes/model/om/BaseAppSequence.php index 7b4b0b01e..4978e1075 100644 --- a/workflow/engine/classes/model/om/BaseAppSequence.php +++ b/workflow/engine/classes/model/om/BaseAppSequence.php @@ -33,6 +33,12 @@ abstract class BaseAppSequence extends BaseObject implements Persistent */ protected $id; + /** + * The value for the app_type field. + * @var string + */ + protected $app_type = 'NORMAL'; + /** * Flag to prevent endless save loop, if this object is referenced * by another object which falls in this transaction. @@ -58,6 +64,17 @@ abstract class BaseAppSequence extends BaseObject implements Persistent return $this->id; } + /** + * Get the [app_type] column value. + * + * @return string + */ + public function getAppType() + { + + return $this->app_type; + } + /** * Set the value of [id] column. * @@ -80,6 +97,28 @@ abstract class BaseAppSequence extends BaseObject implements Persistent } // setId() + /** + * 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 === 'NORMAL') { + $this->app_type = $v; + $this->modifiedColumns[] = AppSequencePeer::APP_TYPE; + } + + } // setAppType() + /** * Hydrates (populates) the object variables with values from the database resultset. * @@ -99,12 +138,14 @@ abstract class BaseAppSequence extends BaseObject implements Persistent $this->id = $rs->getInt($startcol + 0); + $this->app_type = $rs->getString($startcol + 1); + $this->resetModified(); $this->setNew(false); // FIXME - using NUM_COLUMNS may be clearer. - return $startcol + 1; // 1 = AppSequencePeer::NUM_COLUMNS - AppSequencePeer::NUM_LAZY_LOAD_COLUMNS). + return $startcol + 2; // 2 = AppSequencePeer::NUM_COLUMNS - AppSequencePeer::NUM_LAZY_LOAD_COLUMNS). } catch (Exception $e) { throw new PropelException("Error populating AppSequence object", $e); @@ -311,6 +352,9 @@ abstract class BaseAppSequence extends BaseObject implements Persistent case 0: return $this->getId(); break; + case 1: + return $this->getAppType(); + break; default: return null; break; @@ -332,6 +376,7 @@ abstract class BaseAppSequence extends BaseObject implements Persistent $keys = AppSequencePeer::getFieldNames($keyType); $result = array( $keys[0] => $this->getId(), + $keys[1] => $this->getAppType(), ); return $result; } @@ -366,6 +411,9 @@ abstract class BaseAppSequence extends BaseObject implements Persistent case 0: $this->setId($value); break; + case 1: + $this->setAppType($value); + break; } // switch() } @@ -393,6 +441,10 @@ abstract class BaseAppSequence extends BaseObject implements Persistent $this->setId($arr[$keys[0]]); } + if (array_key_exists($keys[1], $arr)) { + $this->setAppType($arr[$keys[1]]); + } + } /** @@ -408,6 +460,10 @@ abstract class BaseAppSequence extends BaseObject implements Persistent $criteria->add(AppSequencePeer::ID, $this->id); } + if ($this->isColumnModified(AppSequencePeer::APP_TYPE)) { + $criteria->add(AppSequencePeer::APP_TYPE, $this->app_type); + } + return $criteria; } @@ -462,6 +518,8 @@ abstract class BaseAppSequence extends BaseObject implements Persistent public function copyInto($copyObj, $deepCopy = false) { + $copyObj->setAppType($this->app_type); + $copyObj->setNew(true); diff --git a/workflow/engine/classes/model/om/BaseAppSequencePeer.php b/workflow/engine/classes/model/om/BaseAppSequencePeer.php index 5586351bb..1a9fd8b4b 100644 --- a/workflow/engine/classes/model/om/BaseAppSequencePeer.php +++ b/workflow/engine/classes/model/om/BaseAppSequencePeer.php @@ -25,7 +25,7 @@ abstract class BaseAppSequencePeer const CLASS_DEFAULT = 'classes.model.AppSequence'; /** The total number of columns. */ - const NUM_COLUMNS = 1; + const NUM_COLUMNS = 2; /** The number of lazy-loaded columns. */ const NUM_LAZY_LOAD_COLUMNS = 0; @@ -34,6 +34,9 @@ abstract class BaseAppSequencePeer /** the column name for the ID field */ const ID = 'APP_SEQUENCE.ID'; + /** the column name for the APP_TYPE field */ + const APP_TYPE = 'APP_SEQUENCE.APP_TYPE'; + /** The PHP to DB Name Mapping */ private static $phpNameMap = null; @@ -45,10 +48,10 @@ abstract class BaseAppSequencePeer * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ private static $fieldNames = array ( - BasePeer::TYPE_PHPNAME => array ('Id', ), - BasePeer::TYPE_COLNAME => array (AppSequencePeer::ID, ), - BasePeer::TYPE_FIELDNAME => array ('ID', ), - BasePeer::TYPE_NUM => array (0, ) + BasePeer::TYPE_PHPNAME => array ('Id', 'AppType', ), + BasePeer::TYPE_COLNAME => array (AppSequencePeer::ID, AppSequencePeer::APP_TYPE, ), + BasePeer::TYPE_FIELDNAME => array ('ID', 'APP_TYPE', ), + BasePeer::TYPE_NUM => array (0, 1, ) ); /** @@ -58,10 +61,10 @@ abstract class BaseAppSequencePeer * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 */ private static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('Id' => 0, ), - BasePeer::TYPE_COLNAME => array (AppSequencePeer::ID => 0, ), - BasePeer::TYPE_FIELDNAME => array ('ID' => 0, ), - BasePeer::TYPE_NUM => array (0, ) + BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'AppType' => 1, ), + BasePeer::TYPE_COLNAME => array (AppSequencePeer::ID => 0, AppSequencePeer::APP_TYPE => 1, ), + BasePeer::TYPE_FIELDNAME => array ('ID' => 0, 'APP_TYPE' => 1, ), + BasePeer::TYPE_NUM => array (0, 1, ) ); /** @@ -164,6 +167,8 @@ abstract class BaseAppSequencePeer $criteria->addSelectColumn(AppSequencePeer::ID); + $criteria->addSelectColumn(AppSequencePeer::APP_TYPE); + } const COUNT = 'COUNT(APP_SEQUENCE.ID)'; diff --git a/workflow/engine/config/schema.xml b/workflow/engine/config/schema.xml index e91f90a66..7731a9880 100755 --- a/workflow/engine/config/schema.xml +++ b/workflow/engine/config/schema.xml @@ -118,6 +118,7 @@ +
diff --git a/workflow/engine/data/mysql/schema.sql b/workflow/engine/data/mysql/schema.sql index 74f04c4cf..cda179bf6 100644 --- a/workflow/engine/data/mysql/schema.sql +++ b/workflow/engine/data/mysql/schema.sql @@ -54,6 +54,7 @@ DROP TABLE IF EXISTS `APP_SEQUENCE`; CREATE TABLE `APP_SEQUENCE` ( `ID` INTEGER NOT NULL, + `APP_TYPE` VARCHAR(20) default 'NORMAL' NOT NULL, PRIMARY KEY (`ID`) )ENGINE=InnoDB ; #-----------------------------------------------------------------------------