diff --git a/workflow/engine/classes/model/AppDelegation.php b/workflow/engine/classes/model/AppDelegation.php index 83f2bf784..58159c550 100755 --- a/workflow/engine/classes/model/AppDelegation.php +++ b/workflow/engine/classes/model/AppDelegation.php @@ -153,8 +153,6 @@ class AppDelegation extends BaseAppDelegation if ($this->validate()) { try { $res = $this->save(); - $inbox = new ListInbox(); - $inbox->newRow($this->toArray(BasePeer::TYPE_FIELDNAME), $delPreviusUsrUid); } catch (PropelException $e) { throw ($e); } @@ -483,7 +481,7 @@ class AppDelegation extends BaseAppDelegation $calData = $calendar->getCalendarData(); //Recalculating DueDate with the user calendar if it exist. It allways will take the derivation date like initial date. - $iDueDate = $calendar->dashCalculateDate($row['DEL_DELEGATE_DATE'], $fTaskDuration, $fTaskDurationUnit, $calData); + $iDueDate = $calendar->dashCalculateDate($row['DEL_DELEGATE_DATE'], $fTaskDuration, $fTaskDurationUnit, $calData); //if the task is not started if ($isStarted == 0) { @@ -497,8 +495,8 @@ class AppDelegation extends BaseAppDelegation $oAppDel->setDelQueueDuration( $queueDuration ); //we are putting negative number if the task is not delayed, and positive number for the time the task is delayed - //$delayDuration = $this->getDiffDate( $now, $iDueDate ); - $delayDuration = $calendar->dashCalculateDurationWithCalendar( $iDueDate, date("Y-m-d H:i:s"), $calData ); + //$delayDuration = $this->getDiffDate( $now, $iDueDate ); + $delayDuration = $calendar->dashCalculateDurationWithCalendar( $iDueDate, date("Y-m-d H:i:s"), $calData ); $delayDuration = $delayDuration / (24 * 60 * 60); //Days $oAppDel->setDelDelayDuration( $delayDuration ); if ($fTaskDuration != 0) { @@ -528,7 +526,7 @@ class AppDelegation extends BaseAppDelegation if ($dueDate < $finishDate) { $oAppDel->setDelDelayed( 1 ); //$delayDuration = $this->getDiffDate( $iFinishDate, $iDueDate ); - $delayDuration = $calendar->dashCalculateDurationWithCalendar( $iDueDate, $row['DEL_FINISH_DATE'], $calData ); + $delayDuration = $calendar->dashCalculateDurationWithCalendar( $iDueDate, $row['DEL_FINISH_DATE'], $calData ); $delayDuration = $delayDuration / (24 * 60 * 60); //Days } else { $oAppDel->setDelDelayed( 0 ); @@ -540,9 +538,9 @@ class AppDelegation extends BaseAppDelegation if ($row['DEL_INIT_DATE'] != null && $row['DEL_INIT_DATE'] != '') { //$delDuration = $this->getDiffDate( $now, $iInitDate ); $delDuration = $calendar->dashCalculateDurationWithCalendar($row['DEL_INIT_DATE'], date("Y-m-d H:i:s"), $calData );//by jen - $delDuration = $delDuration / (24 * 60 * 60); //Saving the delDuration in days. The calculateDurationSLA func returns mins. + $delDuration = $delDuration / (24 * 60 * 60); //Saving the delDuration in days. The calculateDurationSLA func returns mins. } else { - //$delDuration = $this->getDiffDate( $now, $iDelegateDate ); + //$delDuration = $this->getDiffDate( $now, $iDelegateDate ); $delDuration = $calendar->dashCalculateDurationWithCalendar($row['DEL_DELEGATE_DATE'], date("Y-m-d H:i:s"), $calData ); //byJen $delDuration = $delDuration / (24 * 60 * 60); //Saving the delDuration in days. The calculateDurationSLA func returns mins. } @@ -550,7 +548,7 @@ class AppDelegation extends BaseAppDelegation //we are putting negative number if the task is not delayed, and positive number for the time the task is delayed //$delayDuration = $this->getDiffDate( $now, $iDueDate ); - $delayDuration = $calendar->dashCalculateDurationWithCalendar( $iDueDate, date("Y-m-d H:i:s"), $calData ); + $delayDuration = $calendar->dashCalculateDurationWithCalendar( $iDueDate, date("Y-m-d H:i:s"), $calData ); $delayDuration = $delayDuration / (24 * 60 * 60); //Days $oAppDel->setDelDelayDuration( $delayDuration ); if ($fTaskDuration != 0) { diff --git a/workflow/engine/classes/model/map/ApplicationMapBuilder.php b/workflow/engine/classes/model/map/ApplicationMapBuilder.php index 03967c0eb..7bd15b22b 100755 --- a/workflow/engine/classes/model/map/ApplicationMapBuilder.php +++ b/workflow/engine/classes/model/map/ApplicationMapBuilder.php @@ -1,108 +1,108 @@ -dbMap !== null); - } - - /** - * 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'); - - $tMap = $this->dbMap->addTable('APPLICATION'); - $tMap->setPhpName('Application'); - - $tMap->setUseIdGenerator(false); - - $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32); - - $tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, true, null); - - $tMap->addColumn('APP_PARENT', 'AppParent', 'string', CreoleTypes::VARCHAR, true, 32); - - $tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, true, 100); - - $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_CODE', 'AppProcCode', 'string', CreoleTypes::VARCHAR, true, 100); - - $tMap->addColumn('APP_PARALLEL', 'AppParallel', '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_CREATE_DATE', 'AppCreateDate', '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_UPDATE_DATE', 'AppUpdateDate', 'int', CreoleTypes::TIMESTAMP, 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_DURATION', 'AppDuration', 'double', CreoleTypes::DOUBLE, false, null); - - $tMap->addColumn('APP_DELAY_DURATION', 'AppDelayDuration', 'double', CreoleTypes::DOUBLE, false, null); - - $tMap->addValidator('APP_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'DRAFT|TO_DO|PAUSED|COMPLETED|CANCELLED', 'Please select a valid status.'); - - } // doBuild() - -} // ApplicationMapBuilder \ No newline at end of file +dbMap !== null); + } + + /** + * 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'); + + $tMap = $this->dbMap->addTable('APPLICATION'); + $tMap->setPhpName('Application'); + + $tMap->setUseIdGenerator(false); + + $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, true, null); + + $tMap->addColumn('APP_PARENT', 'AppParent', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, true, 100); + + $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_CODE', 'AppProcCode', 'string', CreoleTypes::VARCHAR, true, 100); + + $tMap->addColumn('APP_PARALLEL', 'AppParallel', '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_CREATE_DATE', 'AppCreateDate', '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_UPDATE_DATE', 'AppUpdateDate', 'int', CreoleTypes::TIMESTAMP, 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_DURATION', 'AppDuration', 'double', CreoleTypes::DOUBLE, false, null); + + $tMap->addColumn('APP_DELAY_DURATION', 'AppDelayDuration', 'double', CreoleTypes::DOUBLE, false, null); + + $tMap->addValidator('APP_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'DRAFT|TO_DO|PAUSED|COMPLETED|CANCELLED', 'Please select a valid status.'); + + } // doBuild() + +} // ApplicationMapBuilder diff --git a/workflow/engine/classes/model/map/UsersMapBuilder.php b/workflow/engine/classes/model/map/UsersMapBuilder.php index 25f32a09f..d0f6b208b 100755 --- a/workflow/engine/classes/model/map/UsersMapBuilder.php +++ b/workflow/engine/classes/model/map/UsersMapBuilder.php @@ -130,9 +130,9 @@ class UsersMapBuilder $tMap->addColumn('USR_TOTAL_COMPLETED', 'UsrTotalCompleted', 'int', CreoleTypes::INTEGER, false, null); $tMap->addColumn('USR_TOTAL_UNASSIGNED', 'UsrTotalUnassigned', 'int', CreoleTypes::INTEGER, false, null); - - $tMap->addColumn('USR_COST_BY_HOUR', 'UsrCostByHour', 'double', CreoleTypes::DOUBLE, false, 11,2); - + + $tMap->addColumn('USR_COST_BY_HOUR', 'UsrCostByHour', 'double', CreoleTypes::DOUBLE, false, 11,2); + $tMap->addColumn('USR_UNIT_COST', 'UsrUnitCost', 'string', CreoleTypes::VARCHAR, false, 50); $tMap->addValidator('USR_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|INACTIVE|VACATION|CLOSED', 'Please select a valid type.'); diff --git a/workflow/engine/classes/model/om/BaseApplication.php b/workflow/engine/classes/model/om/BaseApplication.php index 1a80250eb..5a4f94129 100755 --- a/workflow/engine/classes/model/om/BaseApplication.php +++ b/workflow/engine/classes/model/om/BaseApplication.php @@ -1,1595 +1,1596 @@ -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; - } - - /** - * Get the [app_duration] column value. - * - * @return double - */ - public function getAppDuration() - { - - return $this->app_duration; - } - - /** - * Get the [app_delay_duration] column value. - * - * @return double - */ - public function getAppDelayDuration() - { - - return $this->app_delay_duration; - } - - /** - * 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); - //Date/time accepts null values - if ($v == '') { - $ts = null; - } - 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); - //Date/time accepts null values - if ($v == '') { - $ts = null; - } - 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); - //Date/time accepts null values - if ($v == '') { - $ts = null; - } - 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); - //Date/time accepts null values - if ($v == '') { - $ts = null; - } - 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() - - /** - * Set the value of [app_duration] column. - * - * @param double $v new value - * @return void - */ - public function setAppDuration($v) - { - - if ($this->app_duration !== $v || $v === 0) { - $this->app_duration = $v; - $this->modifiedColumns[] = ApplicationPeer::APP_DURATION; - } - - } // setAppDuration() - - /** - * Set the value of [app_delay_duration] column. - * - * @param double $v new value - * @return void - */ - public function setAppDelayDuration($v) - { - - if ($this->app_delay_duration !== $v || $v === 0) { - $this->app_delay_duration = $v; - $this->modifiedColumns[] = ApplicationPeer::APP_DELAY_DURATION; - } - - } // setAppDelayDuration() - - /** - * 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->app_duration = $rs->getFloat($startcol + 16); - - $this->app_delay_duration = $rs->getFloat($startcol + 17); - - $this->resetModified(); - - $this->setNew(false); - - // FIXME - using NUM_COLUMNS may be clearer. - return $startcol + 18; // 18 = 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; - case 16: - return $this->getAppDuration(); - break; - case 17: - return $this->getAppDelayDuration(); - 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(), - $keys[16] => $this->getAppDuration(), - $keys[17] => $this->getAppDelayDuration(), - ); - 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; - case 16: - $this->setAppDuration($value); - break; - case 17: - $this->setAppDelayDuration($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]]); - } - - if (array_key_exists($keys[16], $arr)) { - $this->setAppDuration($arr[$keys[16]]); - } - - if (array_key_exists($keys[17], $arr)) { - $this->setAppDelayDuration($arr[$keys[17]]); - } - - } - - /** - * 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); - } - - if ($this->isColumnModified(ApplicationPeer::APP_DURATION)) { - $criteria->add(ApplicationPeer::APP_DURATION, $this->app_duration); - } - - if ($this->isColumnModified(ApplicationPeer::APP_DELAY_DURATION)) { - $criteria->add(ApplicationPeer::APP_DELAY_DURATION, $this->app_delay_duration); - } - - - 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->setAppDuration($this->app_duration); - - $copyObj->setAppDelayDuration($this->app_delay_duration); - - - $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; - } -} \ No newline at end of file +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; + } + + /** + * Get the [app_duration] column value. + * + * @return double + */ + public function getAppDuration() + { + + return $this->app_duration; + } + + /** + * Get the [app_delay_duration] column value. + * + * @return double + */ + public function getAppDelayDuration() + { + + return $this->app_delay_duration; + } + + /** + * 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); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + 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); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + 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); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + 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); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + 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() + + /** + * Set the value of [app_duration] column. + * + * @param double $v new value + * @return void + */ + public function setAppDuration($v) + { + + if ($this->app_duration !== $v || $v === 0) { + $this->app_duration = $v; + $this->modifiedColumns[] = ApplicationPeer::APP_DURATION; + } + + } // setAppDuration() + + /** + * Set the value of [app_delay_duration] column. + * + * @param double $v new value + * @return void + */ + public function setAppDelayDuration($v) + { + + if ($this->app_delay_duration !== $v || $v === 0) { + $this->app_delay_duration = $v; + $this->modifiedColumns[] = ApplicationPeer::APP_DELAY_DURATION; + } + + } // setAppDelayDuration() + + /** + * 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->app_duration = $rs->getFloat($startcol + 16); + + $this->app_delay_duration = $rs->getFloat($startcol + 17); + + $this->resetModified(); + + $this->setNew(false); + + // FIXME - using NUM_COLUMNS may be clearer. + return $startcol + 18; // 18 = 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; + case 16: + return $this->getAppDuration(); + break; + case 17: + return $this->getAppDelayDuration(); + 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(), + $keys[16] => $this->getAppDuration(), + $keys[17] => $this->getAppDelayDuration(), + ); + 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; + case 16: + $this->setAppDuration($value); + break; + case 17: + $this->setAppDelayDuration($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]]); + } + + if (array_key_exists($keys[16], $arr)) { + $this->setAppDuration($arr[$keys[16]]); + } + + if (array_key_exists($keys[17], $arr)) { + $this->setAppDelayDuration($arr[$keys[17]]); + } + + } + + /** + * 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); + } + + if ($this->isColumnModified(ApplicationPeer::APP_DURATION)) { + $criteria->add(ApplicationPeer::APP_DURATION, $this->app_duration); + } + + if ($this->isColumnModified(ApplicationPeer::APP_DELAY_DURATION)) { + $criteria->add(ApplicationPeer::APP_DELAY_DURATION, $this->app_delay_duration); + } + + + 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->setAppDuration($this->app_duration); + + $copyObj->setAppDelayDuration($this->app_delay_duration); + + + $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; + } +} + diff --git a/workflow/engine/classes/model/om/BaseApplicationPeer.php b/workflow/engine/classes/model/om/BaseApplicationPeer.php index b93e6347f..cc17e5d92 100755 --- a/workflow/engine/classes/model/om/BaseApplicationPeer.php +++ b/workflow/engine/classes/model/om/BaseApplicationPeer.php @@ -1,654 +1,655 @@ - array ('AppUid', 'AppNumber', 'AppParent', 'AppStatus', 'ProUid', 'AppProcStatus', 'AppProcCode', 'AppParallel', 'AppInitUser', 'AppCurUser', 'AppCreateDate', 'AppInitDate', 'AppFinishDate', 'AppUpdateDate', 'AppData', 'AppPin', 'AppDuration', 'AppDelayDuration', ), - 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, ApplicationPeer::APP_DURATION, ApplicationPeer::APP_DELAY_DURATION, ), - 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', 'APP_DURATION', 'APP_DELAY_DURATION', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ) - ); - - /** - * 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, 'AppDuration' => 16, 'AppDelayDuration' => 17, ), - 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, ApplicationPeer::APP_DURATION => 16, ApplicationPeer::APP_DELAY_DURATION => 17, ), - 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, 'APP_DURATION' => 16, 'APP_DELAY_DURATION' => 17, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ) - ); - - /** - * @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); - - $criteria->addSelectColumn(ApplicationPeer::APP_DURATION); - - $criteria->addSelectColumn(ApplicationPeer::APP_DELAY_DURATION); - - } - - 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; - } -} - - -// 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); - } -} 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'); -} \ No newline at end of file + array ('AppUid', 'AppNumber', 'AppParent', 'AppStatus', 'ProUid', 'AppProcStatus', 'AppProcCode', 'AppParallel', 'AppInitUser', 'AppCurUser', 'AppCreateDate', 'AppInitDate', 'AppFinishDate', 'AppUpdateDate', 'AppData', 'AppPin', 'AppDuration', 'AppDelayDuration', ), + 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, ApplicationPeer::APP_DURATION, ApplicationPeer::APP_DELAY_DURATION, ), + 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', 'APP_DURATION', 'APP_DELAY_DURATION', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ) + ); + + /** + * 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, 'AppDuration' => 16, 'AppDelayDuration' => 17, ), + 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, ApplicationPeer::APP_DURATION => 16, ApplicationPeer::APP_DELAY_DURATION => 17, ), + 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, 'APP_DURATION' => 16, 'APP_DELAY_DURATION' => 17, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ) + ); + + /** + * @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); + + $criteria->addSelectColumn(ApplicationPeer::APP_DURATION); + + $criteria->addSelectColumn(ApplicationPeer::APP_DELAY_DURATION); + + } + + 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; + } +} + + +// 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); + } +} 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'); +} + diff --git a/workflow/engine/classes/model/om/BaseUsers.php b/workflow/engine/classes/model/om/BaseUsers.php index 85928d75f..76d198612 100755 --- a/workflow/engine/classes/model/om/BaseUsers.php +++ b/workflow/engine/classes/model/om/BaseUsers.php @@ -183,17 +183,6 @@ abstract class BaseUsers extends BaseObject implements Persistent */ protected $usr_ux = 'NORMAL'; - /** - * The value for the usr_cost_by_hour field. - * @var double - */ - protected $usr_cost_by_hour = 0; - - /** - * The value for the usr_unit_cost field. - * @var string - */ - protected $usr_unit_cost = ''; /** * The value for the usr_total_inbox field. * @var int @@ -236,6 +225,18 @@ abstract class BaseUsers extends BaseObject implements Persistent */ protected $usr_total_unassigned = 0; + /** + * The value for the usr_cost_by_hour field. + * @var double + */ + protected $usr_cost_by_hour = 0; + + /** + * The value for the usr_unit_cost field. + * @var string + */ + protected $usr_unit_cost = ''; + /** * Flag to prevent endless save loop, if this object is referenced * by another object which falls in this transaction. @@ -619,28 +620,6 @@ abstract class BaseUsers extends BaseObject implements Persistent return $this->usr_ux; } - - /** - * Get the [usr_cost_by_hour] column value. - * - * @return double - */ - public function getUsrCostByHour() - { - - return $this->usr_cost_by_hour; - } - - /** - * Get the [usr_unit_cost] column value. - * - * @return string - */ - public function getUsrUnitCost() - { - - return $this->usr_unit_cost; - } /** * Get the [usr_total_inbox] column value. @@ -719,6 +698,28 @@ abstract class BaseUsers extends BaseObject implements Persistent return $this->usr_total_unassigned; } + /** + * Get the [usr_cost_by_hour] column value. + * + * @return double + */ + public function getUsrCostByHour() + { + + return $this->usr_cost_by_hour; + } + + /** + * Get the [usr_unit_cost] column value. + * + * @return string + */ + public function getUsrUnitCost() + { + + return $this->usr_unit_cost; + } + /** * Set the value of [usr_uid] column. * @@ -1319,44 +1320,6 @@ abstract class BaseUsers extends BaseObject implements Persistent } // setUsrUx() - /** - * Set the value of [usr_cost_by_hour] column. - * - * @param double $v new value - * @return void - */ - public function setUsrCostByHour($v) - { - - if ($this->usr_cost_by_hour !== $v || $v === 0) { - $this->usr_cost_by_hour = $v; - $this->modifiedColumns[] = UsersPeer::USR_COST_BY_HOUR; - } - - } // setUsrCostByHour() - - /** - * Set the value of [usr_unit_cost] column. - * - * @param string $v new value - * @return void - */ - public function setUsrUnitCost($v) - { - - // Since the native PHP type for this column is 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_unit_cost !== $v || $v === '') { - $this->usr_unit_cost = $v; - $this->modifiedColumns[] = UsersPeer::USR_UNIT_COST; - } - - } // setUsrUnitCost() - /** * Set the value of [usr_total_inbox] column. * @@ -1511,6 +1474,44 @@ abstract class BaseUsers extends BaseObject implements Persistent } // setUsrTotalUnassigned() + /** + * Set the value of [usr_cost_by_hour] column. + * + * @param double $v new value + * @return void + */ + public function setUsrCostByHour($v) + { + + if ($this->usr_cost_by_hour !== $v || $v === 0) { + $this->usr_cost_by_hour = $v; + $this->modifiedColumns[] = UsersPeer::USR_COST_BY_HOUR; + } + + } // setUsrCostByHour() + + /** + * Set the value of [usr_unit_cost] column. + * + * @param string $v new value + * @return void + */ + public function setUsrUnitCost($v) + { + + // Since the native PHP type for this column is 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_unit_cost !== $v || $v === '') { + $this->usr_unit_cost = $v; + $this->modifiedColumns[] = UsersPeer::USR_UNIT_COST; + } + + } // setUsrUnitCost() + /** * Hydrates (populates) the object variables with values from the database resultset. * @@ -1580,10 +1581,6 @@ abstract class BaseUsers extends BaseObject implements Persistent $this->usr_ux = $rs->getString($startcol + 25); - $this->usr_cost_by_hour = $rs->getFloat($startcol + 26); - - $this->usr_unit_cost = $rs->getString($startcol + 27); - $this->usr_total_inbox = $rs->getInt($startcol + 26); $this->usr_total_draft = $rs->getInt($startcol + 27); @@ -1598,6 +1595,10 @@ abstract class BaseUsers extends BaseObject implements Persistent $this->usr_total_unassigned = $rs->getInt($startcol + 32); + $this->usr_cost_by_hour = $rs->getFloat($startcol + 33); + + $this->usr_unit_cost = $rs->getString($startcol + 34); + $this->resetModified(); $this->setNew(false); @@ -1906,10 +1907,10 @@ abstract class BaseUsers extends BaseObject implements Persistent case 32: return $this->getUsrTotalUnassigned(); break; - case 33: - return $this->getUsrCostByHour(); - break; - case 34: + case 33: + return $this->getUsrCostByHour(); + break; + case 34: return $this->getUsrUnitCost(); break; default: @@ -1965,8 +1966,8 @@ abstract class BaseUsers extends BaseObject implements Persistent $keys[30] => $this->getUsrTotalPaused(), $keys[31] => $this->getUsrTotalCompleted(), $keys[32] => $this->getUsrTotalUnassigned(), - $keys[33] => $this->getUsrCostByHour(), - $keys[34] => $this->getUsrUnitCost(), + $keys[33] => $this->getUsrCostByHour(), + $keys[34] => $this->getUsrUnitCost(), ); return $result; } @@ -2097,10 +2098,10 @@ abstract class BaseUsers extends BaseObject implements Persistent case 32: $this->setUsrTotalUnassigned($value); break; - case 26: - $this->setUsrCostByHour($value); - break; - case 27: + case 33: + $this->setUsrCostByHour($value); + break; + case 34: $this->setUsrUnitCost($value); break; } // switch() @@ -2258,12 +2259,12 @@ abstract class BaseUsers extends BaseObject implements Persistent $this->setUsrTotalUnassigned($arr[$keys[32]]); } - if (array_key_exists($keys[33], $arr)) { - $this->setUsrCostByHour($arr[$keys[26]]); - } - - if (array_key_exists($keys[34], $arr)) { - $this->setUsrUnitCost($arr[$keys[27]]); + if (array_key_exists($keys[33], $arr)) { + $this->setUsrCostByHour($arr[$keys[33]]); + } + + if (array_key_exists($keys[34], $arr)) { + $this->setUsrUnitCost($arr[$keys[34]]); } } @@ -2409,14 +2410,15 @@ abstract class BaseUsers extends BaseObject implements Persistent $criteria->add(UsersPeer::USR_TOTAL_UNASSIGNED, $this->usr_total_unassigned); } - if ($this->isColumnModified(UsersPeer::USR_COST_BY_HOUR)) { - $criteria->add(UsersPeer::USR_COST_BY_HOUR, $this->usr_cost_by_hour); - } - - if ($this->isColumnModified(UsersPeer::USR_UNIT_COST)) { - $criteria->add(UsersPeer::USR_UNIT_COST, $this->usr_unit_cost); + if ($this->isColumnModified(UsersPeer::USR_COST_BY_HOUR)) { + $criteria->add(UsersPeer::USR_COST_BY_HOUR, $this->usr_cost_by_hour); } + if ($this->isColumnModified(UsersPeer::USR_UNIT_COST)) { + $criteria->add(UsersPeer::USR_UNIT_COST, $this->usr_unit_cost); + } + + return $criteria; } @@ -2533,11 +2535,12 @@ abstract class BaseUsers extends BaseObject implements Persistent $copyObj->setUsrTotalCompleted($this->usr_total_completed); $copyObj->setUsrTotalUnassigned($this->usr_total_unassigned); - - $copyObj->setUsrCostByHour($this->usr_cost_by_hour); - + + $copyObj->setUsrCostByHour($this->usr_cost_by_hour); + $copyObj->setUsrUnitCost($this->usr_unit_cost); + $copyObj->setNew(true); $copyObj->setUsrUid(''); // this is a pkey column, so set to default value diff --git a/workflow/engine/classes/model/om/BaseUsersPeer.php b/workflow/engine/classes/model/om/BaseUsersPeer.php index 98595ceba..01013ab62 100755 --- a/workflow/engine/classes/model/om/BaseUsersPeer.php +++ b/workflow/engine/classes/model/om/BaseUsersPeer.php @@ -25,7 +25,7 @@ abstract class BaseUsersPeer const CLASS_DEFAULT = 'classes.model.Users'; /** The total number of columns. */ - const NUM_COLUMNS = 33; + const NUM_COLUMNS = 35; /** The number of lazy-loaded columns. */ const NUM_LAZY_LOAD_COLUMNS = 0; @@ -130,6 +130,12 @@ abstract class BaseUsersPeer /** the column name for the USR_TOTAL_UNASSIGNED field */ const USR_TOTAL_UNASSIGNED = 'USERS.USR_TOTAL_UNASSIGNED'; + /** the column name for the USR_COST_BY_HOUR field */ + const USR_COST_BY_HOUR = 'USERS.USR_COST_BY_HOUR'; + + /** the column name for the USR_UNIT_COST field */ + const USR_UNIT_COST = 'USERS.USR_UNIT_COST'; + /** The PHP to DB Name Mapping */ private static $phpNameMap = null; @@ -141,10 +147,10 @@ abstract class BaseUsersPeer * 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', 'UsrTotalInbox', 'UsrTotalDraft', 'UsrTotalCancelled', 'UsrTotalParticipated', 'UsrTotalPaused', 'UsrTotalCompleted', 'UsrTotalUnassigned', ), - 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, UsersPeer::USR_TOTAL_INBOX, UsersPeer::USR_TOTAL_DRAFT, UsersPeer::USR_TOTAL_CANCELLED, UsersPeer::USR_TOTAL_PARTICIPATED, UsersPeer::USR_TOTAL_PAUSED, UsersPeer::USR_TOTAL_COMPLETED, UsersPeer::USR_TOTAL_UNASSIGNED, ), - 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', 'USR_TOTAL_INBOX', 'USR_TOTAL_DRAFT', 'USR_TOTAL_CANCELLED', 'USR_TOTAL_PARTICIPATED', 'USR_TOTAL_PAUSED', 'USR_TOTAL_COMPLETED', 'USR_TOTAL_UNASSIGNED', ), - 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, ) + 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', 'UsrTotalInbox', 'UsrTotalDraft', 'UsrTotalCancelled', 'UsrTotalParticipated', 'UsrTotalPaused', 'UsrTotalCompleted', 'UsrTotalUnassigned', 'UsrCostByHour', 'UsrUnitCost', ), + 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, UsersPeer::USR_TOTAL_INBOX, UsersPeer::USR_TOTAL_DRAFT, UsersPeer::USR_TOTAL_CANCELLED, UsersPeer::USR_TOTAL_PARTICIPATED, UsersPeer::USR_TOTAL_PAUSED, UsersPeer::USR_TOTAL_COMPLETED, UsersPeer::USR_TOTAL_UNASSIGNED, UsersPeer::USR_COST_BY_HOUR, UsersPeer::USR_UNIT_COST, ), + 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', 'USR_TOTAL_INBOX', 'USR_TOTAL_DRAFT', 'USR_TOTAL_CANCELLED', 'USR_TOTAL_PARTICIPATED', 'USR_TOTAL_PAUSED', 'USR_TOTAL_COMPLETED', 'USR_TOTAL_UNASSIGNED', 'USR_COST_BY_HOUR', 'USR_UNIT_COST', ), + 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, ) ); /** @@ -154,10 +160,10 @@ abstract class BaseUsersPeer * 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, 'UsrTotalInbox' => 26, 'UsrTotalDraft' => 27, 'UsrTotalCancelled' => 28, 'UsrTotalParticipated' => 29, 'UsrTotalPaused' => 30, 'UsrTotalCompleted' => 31, 'UsrTotalUnassigned' => 32, ), - 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, UsersPeer::USR_TOTAL_INBOX => 26, UsersPeer::USR_TOTAL_DRAFT => 27, UsersPeer::USR_TOTAL_CANCELLED => 28, UsersPeer::USR_TOTAL_PARTICIPATED => 29, UsersPeer::USR_TOTAL_PAUSED => 30, UsersPeer::USR_TOTAL_COMPLETED => 31, UsersPeer::USR_TOTAL_UNASSIGNED => 32, ), - 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, 'USR_TOTAL_INBOX' => 26, 'USR_TOTAL_DRAFT' => 27, 'USR_TOTAL_CANCELLED' => 28, 'USR_TOTAL_PARTICIPATED' => 29, 'USR_TOTAL_PAUSED' => 30, 'USR_TOTAL_COMPLETED' => 31, 'USR_TOTAL_UNASSIGNED' => 32, ), - 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, ) + 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, 'UsrTotalInbox' => 26, 'UsrTotalDraft' => 27, 'UsrTotalCancelled' => 28, 'UsrTotalParticipated' => 29, 'UsrTotalPaused' => 30, 'UsrTotalCompleted' => 31, 'UsrTotalUnassigned' => 32, 'UsrCostByHour' => 33, 'UsrUnitCost' => 34, ), + 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, UsersPeer::USR_TOTAL_INBOX => 26, UsersPeer::USR_TOTAL_DRAFT => 27, UsersPeer::USR_TOTAL_CANCELLED => 28, UsersPeer::USR_TOTAL_PARTICIPATED => 29, UsersPeer::USR_TOTAL_PAUSED => 30, UsersPeer::USR_TOTAL_COMPLETED => 31, UsersPeer::USR_TOTAL_UNASSIGNED => 32, UsersPeer::USR_COST_BY_HOUR => 33, UsersPeer::USR_UNIT_COST => 34, ), + 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, 'USR_TOTAL_INBOX' => 26, 'USR_TOTAL_DRAFT' => 27, 'USR_TOTAL_CANCELLED' => 28, 'USR_TOTAL_PARTICIPATED' => 29, 'USR_TOTAL_PAUSED' => 30, 'USR_TOTAL_COMPLETED' => 31, 'USR_TOTAL_UNASSIGNED' => 32, 'USR_COST_BY_HOUR' => 33, 'USR_UNIT_COST' => 34, ), + 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, ) ); /** @@ -324,6 +330,10 @@ abstract class BaseUsersPeer $criteria->addSelectColumn(UsersPeer::USR_TOTAL_UNASSIGNED); + $criteria->addSelectColumn(UsersPeer::USR_COST_BY_HOUR); + + $criteria->addSelectColumn(UsersPeer::USR_UNIT_COST); + } const COUNT = 'COUNT(USERS.USR_UID)'; diff --git a/workflow/engine/config/schema.xml b/workflow/engine/config/schema.xml index 2df8a96a0..ea4c9dd1f 100755 --- a/workflow/engine/config/schema.xml +++ b/workflow/engine/config/schema.xml @@ -37,6 +37,8 @@ + +