From 1dfce5a07450e986d4abe65a55e630fbeffae104 Mon Sep 17 00:00:00 2001 From: Brayan Pereyra Date: Mon, 2 Feb 2015 10:10:22 -0400 Subject: [PATCH] LISTS: Adicion de ESQUEMA y MODELO --- .../engine/classes/model/ListCanceled.php | 19 + .../engine/classes/model/ListCanceledPeer.php | 23 + workflow/engine/classes/model/ListPaused.php | 19 + .../engine/classes/model/ListPausedPeer.php | 23 + .../model/map/ListCanceledMapBuilder.php | 106 ++ .../model/map/ListPausedMapBuilder.php | 106 ++ .../classes/model/om/BaseListCanceled.php | 1608 ++++++++++++++++ .../classes/model/om/BaseListCanceledPeer.php | 652 +++++++ .../classes/model/om/BaseListPaused.php | 1648 +++++++++++++++++ .../classes/model/om/BaseListPausedPeer.php | 642 +++++++ 10 files changed, 4846 insertions(+) create mode 100644 workflow/engine/classes/model/ListCanceled.php create mode 100644 workflow/engine/classes/model/ListCanceledPeer.php create mode 100644 workflow/engine/classes/model/ListPaused.php create mode 100644 workflow/engine/classes/model/ListPausedPeer.php create mode 100644 workflow/engine/classes/model/map/ListCanceledMapBuilder.php create mode 100644 workflow/engine/classes/model/map/ListPausedMapBuilder.php create mode 100644 workflow/engine/classes/model/om/BaseListCanceled.php create mode 100644 workflow/engine/classes/model/om/BaseListCanceledPeer.php create mode 100644 workflow/engine/classes/model/om/BaseListPaused.php create mode 100644 workflow/engine/classes/model/om/BaseListPausedPeer.php diff --git a/workflow/engine/classes/model/ListCanceled.php b/workflow/engine/classes/model/ListCanceled.php new file mode 100644 index 000000000..a703a5bb3 --- /dev/null +++ b/workflow/engine/classes/model/ListCanceled.php @@ -0,0 +1,19 @@ +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('LIST_CANCELED'); + $tMap->setPhpName('ListCanceled'); + + $tMap->setUseIdGenerator(false); + + $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, true, null); + + $tMap->addColumn('APP_TITLE', 'AppTitle', 'string', CreoleTypes::VARCHAR, true, 255); + + $tMap->addColumn('APP_PRO_TITLE', 'AppProTitle', 'string', CreoleTypes::VARCHAR, true, 255); + + $tMap->addColumn('APP_TAS_TITLE', 'AppTasTitle', 'string', CreoleTypes::VARCHAR, true, 255); + + $tMap->addColumn('APP_CANCELED_DATE', 'AppCanceledDate', 'int', CreoleTypes::TIMESTAMP, true, null); + + $tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null); + + $tMap->addColumn('DEL_PREVIOUS_USR_UID', 'DelPreviousUsrUid', 'string', CreoleTypes::VARCHAR, false, 32); + + $tMap->addColumn('DEL_CURRENT_USR_USERNAME', 'DelCurrentUsrUsername', 'string', CreoleTypes::VARCHAR, false, 100); + + $tMap->addColumn('DEL_CURRENT_USR_FIRSTNAME', 'DelCurrentUsrFirstname', 'string', CreoleTypes::VARCHAR, false, 50); + + $tMap->addColumn('DEL_CURRENT_USR_LASTNAME', 'DelCurrentUsrLastname', 'string', CreoleTypes::VARCHAR, false, 50); + + $tMap->addColumn('DEL_DELEGATE_DATE', 'DelDelegateDate', 'int', CreoleTypes::TIMESTAMP, true, null); + + $tMap->addColumn('DEL_INIT_DATE', 'DelInitDate', 'int', CreoleTypes::TIMESTAMP, false, null); + + $tMap->addColumn('DEL_DUE_DATE', 'DelDueDate', 'int', CreoleTypes::TIMESTAMP, false, null); + + $tMap->addColumn('DEL_PRIORITY', 'DelPriority', 'string', CreoleTypes::VARCHAR, true, 32); + + } // doBuild() + +} // ListCanceledMapBuilder diff --git a/workflow/engine/classes/model/map/ListPausedMapBuilder.php b/workflow/engine/classes/model/map/ListPausedMapBuilder.php new file mode 100644 index 000000000..e7cd450a5 --- /dev/null +++ b/workflow/engine/classes/model/map/ListPausedMapBuilder.php @@ -0,0 +1,106 @@ +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('LIST_PAUSED'); + $tMap->setPhpName('ListPaused'); + + $tMap->setUseIdGenerator(false); + + $tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addPrimaryKey('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null); + + $tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32); + + $tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, true, null); + + $tMap->addColumn('APP_TITLE', 'AppTitle', 'string', CreoleTypes::VARCHAR, true, 255); + + $tMap->addColumn('APP_PRO_TITLE', 'AppProTitle', 'string', CreoleTypes::VARCHAR, true, 255); + + $tMap->addColumn('APP_TAS_TITLE', 'AppTasTitle', 'string', CreoleTypes::VARCHAR, true, 255); + + $tMap->addColumn('APP_PAUSED_DATE', 'AppPausedDate', 'int', CreoleTypes::TIMESTAMP, true, null); + + $tMap->addColumn('APP_RESTART_DATE', 'AppRestartDate', 'int', CreoleTypes::TIMESTAMP, true, null); + + $tMap->addColumn('DEL_CURRENT_USR_USERNAME', 'DelCurrentUsrUsername', 'string', CreoleTypes::VARCHAR, false, 100); + + $tMap->addColumn('DEL_CURRENT_USR_FIRSTNAME', 'DelCurrentUsrFirstname', 'string', CreoleTypes::VARCHAR, false, 50); + + $tMap->addColumn('DEL_CURRENT_USR_LASTNAME', 'DelCurrentUsrLastname', 'string', CreoleTypes::VARCHAR, false, 50); + + $tMap->addColumn('DEL_DELEGATE_DATE', 'DelDelegateDate', 'int', CreoleTypes::TIMESTAMP, true, null); + + $tMap->addColumn('DEL_INIT_DATE', 'DelInitDate', 'int', CreoleTypes::TIMESTAMP, false, null); + + $tMap->addColumn('DEL_DUE_DATE', 'DelDueDate', 'int', CreoleTypes::TIMESTAMP, false, null); + + $tMap->addColumn('DEL_PRIORITY', 'DelPriority', 'string', CreoleTypes::VARCHAR, true, 32); + + } // doBuild() + +} // ListPausedMapBuilder diff --git a/workflow/engine/classes/model/om/BaseListCanceled.php b/workflow/engine/classes/model/om/BaseListCanceled.php new file mode 100644 index 000000000..14bdcb1d6 --- /dev/null +++ b/workflow/engine/classes/model/om/BaseListCanceled.php @@ -0,0 +1,1608 @@ +app_uid; + } + + /** + * Get the [usr_uid] column value. + * + * @return string + */ + public function getUsrUid() + { + + return $this->usr_uid; + } + + /** + * Get the [tas_uid] column value. + * + * @return string + */ + public function getTasUid() + { + + return $this->tas_uid; + } + + /** + * Get the [pro_uid] column value. + * + * @return string + */ + public function getProUid() + { + + return $this->pro_uid; + } + + /** + * Get the [app_number] column value. + * + * @return int + */ + public function getAppNumber() + { + + return $this->app_number; + } + + /** + * Get the [app_title] column value. + * + * @return string + */ + public function getAppTitle() + { + + return $this->app_title; + } + + /** + * Get the [app_pro_title] column value. + * + * @return string + */ + public function getAppProTitle() + { + + return $this->app_pro_title; + } + + /** + * Get the [app_tas_title] column value. + * + * @return string + */ + public function getAppTasTitle() + { + + return $this->app_tas_title; + } + + /** + * Get the [optionally formatted] [app_canceled_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 getAppCanceledDate($format = 'Y-m-d H:i:s') + { + + if ($this->app_canceled_date === null || $this->app_canceled_date === '') { + return null; + } elseif (!is_int($this->app_canceled_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->app_canceled_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [app_canceled_date] as date/time value: " . + var_export($this->app_canceled_date, true)); + } + } else { + $ts = $this->app_canceled_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [del_index] column value. + * + * @return int + */ + public function getDelIndex() + { + + return $this->del_index; + } + + /** + * Get the [del_previous_usr_uid] column value. + * + * @return string + */ + public function getDelPreviousUsrUid() + { + + return $this->del_previous_usr_uid; + } + + /** + * Get the [del_current_usr_username] column value. + * + * @return string + */ + public function getDelCurrentUsrUsername() + { + + return $this->del_current_usr_username; + } + + /** + * Get the [del_current_usr_firstname] column value. + * + * @return string + */ + public function getDelCurrentUsrFirstname() + { + + return $this->del_current_usr_firstname; + } + + /** + * Get the [del_current_usr_lastname] column value. + * + * @return string + */ + public function getDelCurrentUsrLastname() + { + + return $this->del_current_usr_lastname; + } + + /** + * Get the [optionally formatted] [del_delegate_date] column value. + * + * @param string $format The date/time format string (either date()-style or strftime()-style). + * If format is NULL, then the integer unix timestamp will be returned. + * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL). + * @throws PropelException - if unable to convert the date/time to timestamp. + */ + public function getDelDelegateDate($format = 'Y-m-d H:i:s') + { + + if ($this->del_delegate_date === null || $this->del_delegate_date === '') { + return null; + } elseif (!is_int($this->del_delegate_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->del_delegate_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [del_delegate_date] as date/time value: " . + var_export($this->del_delegate_date, true)); + } + } else { + $ts = $this->del_delegate_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [optionally formatted] [del_init_date] column value. + * + * @param string $format The date/time format string (either date()-style or strftime()-style). + * If format is NULL, then the integer unix timestamp will be returned. + * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL). + * @throws PropelException - if unable to convert the date/time to timestamp. + */ + public function getDelInitDate($format = 'Y-m-d H:i:s') + { + + if ($this->del_init_date === null || $this->del_init_date === '') { + return null; + } elseif (!is_int($this->del_init_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->del_init_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [del_init_date] as date/time value: " . + var_export($this->del_init_date, true)); + } + } else { + $ts = $this->del_init_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [optionally formatted] [del_due_date] column value. + * + * @param string $format The date/time format string (either date()-style or strftime()-style). + * If format is NULL, then the integer unix timestamp will be returned. + * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL). + * @throws PropelException - if unable to convert the date/time to timestamp. + */ + public function getDelDueDate($format = 'Y-m-d H:i:s') + { + + if ($this->del_due_date === null || $this->del_due_date === '') { + return null; + } elseif (!is_int($this->del_due_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->del_due_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [del_due_date] as date/time value: " . + var_export($this->del_due_date, true)); + } + } else { + $ts = $this->del_due_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [del_priority] column value. + * + * @return string + */ + public function getDelPriority() + { + + return $this->del_priority; + } + + /** + * 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[] = ListCanceledPeer::APP_UID; + } + + } // setAppUid() + + /** + * Set the value of [usr_uid] column. + * + * @param string $v new value + * @return void + */ + public function setUsrUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->usr_uid !== $v || $v === '') { + $this->usr_uid = $v; + $this->modifiedColumns[] = ListCanceledPeer::USR_UID; + } + + } // setUsrUid() + + /** + * Set the value of [tas_uid] column. + * + * @param string $v new value + * @return void + */ + public function setTasUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->tas_uid !== $v || $v === '') { + $this->tas_uid = $v; + $this->modifiedColumns[] = ListCanceledPeer::TAS_UID; + } + + } // setTasUid() + + /** + * Set the value of [pro_uid] column. + * + * @param string $v new value + * @return void + */ + public function setProUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->pro_uid !== $v || $v === '') { + $this->pro_uid = $v; + $this->modifiedColumns[] = ListCanceledPeer::PRO_UID; + } + + } // setProUid() + + /** + * 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[] = ListCanceledPeer::APP_NUMBER; + } + + } // setAppNumber() + + /** + * Set the value of [app_title] column. + * + * @param string $v new value + * @return void + */ + public function setAppTitle($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->app_title !== $v || $v === '') { + $this->app_title = $v; + $this->modifiedColumns[] = ListCanceledPeer::APP_TITLE; + } + + } // setAppTitle() + + /** + * Set the value of [app_pro_title] column. + * + * @param string $v new value + * @return void + */ + public function setAppProTitle($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->app_pro_title !== $v || $v === '') { + $this->app_pro_title = $v; + $this->modifiedColumns[] = ListCanceledPeer::APP_PRO_TITLE; + } + + } // setAppProTitle() + + /** + * Set the value of [app_tas_title] column. + * + * @param string $v new value + * @return void + */ + public function setAppTasTitle($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->app_tas_title !== $v || $v === '') { + $this->app_tas_title = $v; + $this->modifiedColumns[] = ListCanceledPeer::APP_TAS_TITLE; + } + + } // setAppTasTitle() + + /** + * Set the value of [app_canceled_date] column. + * + * @param int $v new value + * @return void + */ + public function setAppCanceledDate($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_canceled_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->app_canceled_date !== $ts) { + $this->app_canceled_date = $ts; + $this->modifiedColumns[] = ListCanceledPeer::APP_CANCELED_DATE; + } + + } // setAppCanceledDate() + + /** + * Set the value of [del_index] column. + * + * @param int $v new value + * @return void + */ + public function setDelIndex($v) + { + + // Since the native PHP type for this column is integer, + // we will cast the input value to an int (if it is not). + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->del_index !== $v || $v === 0) { + $this->del_index = $v; + $this->modifiedColumns[] = ListCanceledPeer::DEL_INDEX; + } + + } // setDelIndex() + + /** + * Set the value of [del_previous_usr_uid] column. + * + * @param string $v new value + * @return void + */ + public function setDelPreviousUsrUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_previous_usr_uid !== $v || $v === '') { + $this->del_previous_usr_uid = $v; + $this->modifiedColumns[] = ListCanceledPeer::DEL_PREVIOUS_USR_UID; + } + + } // setDelPreviousUsrUid() + + /** + * Set the value of [del_current_usr_username] column. + * + * @param string $v new value + * @return void + */ + public function setDelCurrentUsrUsername($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_current_usr_username !== $v || $v === '') { + $this->del_current_usr_username = $v; + $this->modifiedColumns[] = ListCanceledPeer::DEL_CURRENT_USR_USERNAME; + } + + } // setDelCurrentUsrUsername() + + /** + * Set the value of [del_current_usr_firstname] column. + * + * @param string $v new value + * @return void + */ + public function setDelCurrentUsrFirstname($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_current_usr_firstname !== $v || $v === '') { + $this->del_current_usr_firstname = $v; + $this->modifiedColumns[] = ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME; + } + + } // setDelCurrentUsrFirstname() + + /** + * Set the value of [del_current_usr_lastname] column. + * + * @param string $v new value + * @return void + */ + public function setDelCurrentUsrLastname($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_current_usr_lastname !== $v || $v === '') { + $this->del_current_usr_lastname = $v; + $this->modifiedColumns[] = ListCanceledPeer::DEL_CURRENT_USR_LASTNAME; + } + + } // setDelCurrentUsrLastname() + + /** + * Set the value of [del_delegate_date] column. + * + * @param int $v new value + * @return void + */ + public function setDelDelegateDate($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse date/time value for [del_delegate_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->del_delegate_date !== $ts) { + $this->del_delegate_date = $ts; + $this->modifiedColumns[] = ListCanceledPeer::DEL_DELEGATE_DATE; + } + + } // setDelDelegateDate() + + /** + * Set the value of [del_init_date] column. + * + * @param int $v new value + * @return void + */ + public function setDelInitDate($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse date/time value for [del_init_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->del_init_date !== $ts) { + $this->del_init_date = $ts; + $this->modifiedColumns[] = ListCanceledPeer::DEL_INIT_DATE; + } + + } // setDelInitDate() + + /** + * Set the value of [del_due_date] column. + * + * @param int $v new value + * @return void + */ + public function setDelDueDate($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 [del_due_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->del_due_date !== $ts) { + $this->del_due_date = $ts; + $this->modifiedColumns[] = ListCanceledPeer::DEL_DUE_DATE; + } + + } // setDelDueDate() + + /** + * Set the value of [del_priority] column. + * + * @param string $v new value + * @return void + */ + public function setDelPriority($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_priority !== $v || $v === '3') { + $this->del_priority = $v; + $this->modifiedColumns[] = ListCanceledPeer::DEL_PRIORITY; + } + + } // setDelPriority() + + /** + * Hydrates (populates) the object variables with values from the database resultset. + * + * An offset (1-based "start column") is specified so that objects can be hydrated + * with a subset of the columns in the resultset rows. This is needed, for example, + * for results of JOIN queries where the resultset row includes columns from two or + * more tables. + * + * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos. + * @param int $startcol 1-based offset column which indicates which restultset column to start with. + * @return int next starting column + * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. + */ + public function hydrate(ResultSet $rs, $startcol = 1) + { + try { + + $this->app_uid = $rs->getString($startcol + 0); + + $this->usr_uid = $rs->getString($startcol + 1); + + $this->tas_uid = $rs->getString($startcol + 2); + + $this->pro_uid = $rs->getString($startcol + 3); + + $this->app_number = $rs->getInt($startcol + 4); + + $this->app_title = $rs->getString($startcol + 5); + + $this->app_pro_title = $rs->getString($startcol + 6); + + $this->app_tas_title = $rs->getString($startcol + 7); + + $this->app_canceled_date = $rs->getTimestamp($startcol + 8, null); + + $this->del_index = $rs->getInt($startcol + 9); + + $this->del_previous_usr_uid = $rs->getString($startcol + 10); + + $this->del_current_usr_username = $rs->getString($startcol + 11); + + $this->del_current_usr_firstname = $rs->getString($startcol + 12); + + $this->del_current_usr_lastname = $rs->getString($startcol + 13); + + $this->del_delegate_date = $rs->getTimestamp($startcol + 14, null); + + $this->del_init_date = $rs->getTimestamp($startcol + 15, null); + + $this->del_due_date = $rs->getTimestamp($startcol + 16, null); + + $this->del_priority = $rs->getString($startcol + 17); + + $this->resetModified(); + + $this->setNew(false); + + // FIXME - using NUM_COLUMNS may be clearer. + return $startcol + 18; // 18 = ListCanceledPeer::NUM_COLUMNS - ListCanceledPeer::NUM_LAZY_LOAD_COLUMNS). + + } catch (Exception $e) { + throw new PropelException("Error populating ListCanceled 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(ListCanceledPeer::DATABASE_NAME); + } + + try { + $con->begin(); + ListCanceledPeer::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(ListCanceledPeer::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 = ListCanceledPeer::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 += ListCanceledPeer::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 = ListCanceledPeer::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 = ListCanceledPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->getByPosition($pos); + } + + /** + * Retrieves a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @return mixed Value of field at $pos + */ + public function getByPosition($pos) + { + switch($pos) { + case 0: + return $this->getAppUid(); + break; + case 1: + return $this->getUsrUid(); + break; + case 2: + return $this->getTasUid(); + break; + case 3: + return $this->getProUid(); + break; + case 4: + return $this->getAppNumber(); + break; + case 5: + return $this->getAppTitle(); + break; + case 6: + return $this->getAppProTitle(); + break; + case 7: + return $this->getAppTasTitle(); + break; + case 8: + return $this->getAppCanceledDate(); + break; + case 9: + return $this->getDelIndex(); + break; + case 10: + return $this->getDelPreviousUsrUid(); + break; + case 11: + return $this->getDelCurrentUsrUsername(); + break; + case 12: + return $this->getDelCurrentUsrFirstname(); + break; + case 13: + return $this->getDelCurrentUsrLastname(); + break; + case 14: + return $this->getDelDelegateDate(); + break; + case 15: + return $this->getDelInitDate(); + break; + case 16: + return $this->getDelDueDate(); + break; + case 17: + return $this->getDelPriority(); + 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 = ListCanceledPeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getAppUid(), + $keys[1] => $this->getUsrUid(), + $keys[2] => $this->getTasUid(), + $keys[3] => $this->getProUid(), + $keys[4] => $this->getAppNumber(), + $keys[5] => $this->getAppTitle(), + $keys[6] => $this->getAppProTitle(), + $keys[7] => $this->getAppTasTitle(), + $keys[8] => $this->getAppCanceledDate(), + $keys[9] => $this->getDelIndex(), + $keys[10] => $this->getDelPreviousUsrUid(), + $keys[11] => $this->getDelCurrentUsrUsername(), + $keys[12] => $this->getDelCurrentUsrFirstname(), + $keys[13] => $this->getDelCurrentUsrLastname(), + $keys[14] => $this->getDelDelegateDate(), + $keys[15] => $this->getDelInitDate(), + $keys[16] => $this->getDelDueDate(), + $keys[17] => $this->getDelPriority(), + ); + 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 = ListCanceledPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->setByPosition($pos, $value); + } + + /** + * Sets a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @param mixed $value field value + * @return void + */ + public function setByPosition($pos, $value) + { + switch($pos) { + case 0: + $this->setAppUid($value); + break; + case 1: + $this->setUsrUid($value); + break; + case 2: + $this->setTasUid($value); + break; + case 3: + $this->setProUid($value); + break; + case 4: + $this->setAppNumber($value); + break; + case 5: + $this->setAppTitle($value); + break; + case 6: + $this->setAppProTitle($value); + break; + case 7: + $this->setAppTasTitle($value); + break; + case 8: + $this->setAppCanceledDate($value); + break; + case 9: + $this->setDelIndex($value); + break; + case 10: + $this->setDelPreviousUsrUid($value); + break; + case 11: + $this->setDelCurrentUsrUsername($value); + break; + case 12: + $this->setDelCurrentUsrFirstname($value); + break; + case 13: + $this->setDelCurrentUsrLastname($value); + break; + case 14: + $this->setDelDelegateDate($value); + break; + case 15: + $this->setDelInitDate($value); + break; + case 16: + $this->setDelDueDate($value); + break; + case 17: + $this->setDelPriority($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 = ListCanceledPeer::getFieldNames($keyType); + + if (array_key_exists($keys[0], $arr)) { + $this->setAppUid($arr[$keys[0]]); + } + + if (array_key_exists($keys[1], $arr)) { + $this->setUsrUid($arr[$keys[1]]); + } + + if (array_key_exists($keys[2], $arr)) { + $this->setTasUid($arr[$keys[2]]); + } + + if (array_key_exists($keys[3], $arr)) { + $this->setProUid($arr[$keys[3]]); + } + + if (array_key_exists($keys[4], $arr)) { + $this->setAppNumber($arr[$keys[4]]); + } + + if (array_key_exists($keys[5], $arr)) { + $this->setAppTitle($arr[$keys[5]]); + } + + if (array_key_exists($keys[6], $arr)) { + $this->setAppProTitle($arr[$keys[6]]); + } + + if (array_key_exists($keys[7], $arr)) { + $this->setAppTasTitle($arr[$keys[7]]); + } + + if (array_key_exists($keys[8], $arr)) { + $this->setAppCanceledDate($arr[$keys[8]]); + } + + if (array_key_exists($keys[9], $arr)) { + $this->setDelIndex($arr[$keys[9]]); + } + + if (array_key_exists($keys[10], $arr)) { + $this->setDelPreviousUsrUid($arr[$keys[10]]); + } + + if (array_key_exists($keys[11], $arr)) { + $this->setDelCurrentUsrUsername($arr[$keys[11]]); + } + + if (array_key_exists($keys[12], $arr)) { + $this->setDelCurrentUsrFirstname($arr[$keys[12]]); + } + + if (array_key_exists($keys[13], $arr)) { + $this->setDelCurrentUsrLastname($arr[$keys[13]]); + } + + if (array_key_exists($keys[14], $arr)) { + $this->setDelDelegateDate($arr[$keys[14]]); + } + + if (array_key_exists($keys[15], $arr)) { + $this->setDelInitDate($arr[$keys[15]]); + } + + if (array_key_exists($keys[16], $arr)) { + $this->setDelDueDate($arr[$keys[16]]); + } + + if (array_key_exists($keys[17], $arr)) { + $this->setDelPriority($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(ListCanceledPeer::DATABASE_NAME); + + if ($this->isColumnModified(ListCanceledPeer::APP_UID)) { + $criteria->add(ListCanceledPeer::APP_UID, $this->app_uid); + } + + if ($this->isColumnModified(ListCanceledPeer::USR_UID)) { + $criteria->add(ListCanceledPeer::USR_UID, $this->usr_uid); + } + + if ($this->isColumnModified(ListCanceledPeer::TAS_UID)) { + $criteria->add(ListCanceledPeer::TAS_UID, $this->tas_uid); + } + + if ($this->isColumnModified(ListCanceledPeer::PRO_UID)) { + $criteria->add(ListCanceledPeer::PRO_UID, $this->pro_uid); + } + + if ($this->isColumnModified(ListCanceledPeer::APP_NUMBER)) { + $criteria->add(ListCanceledPeer::APP_NUMBER, $this->app_number); + } + + if ($this->isColumnModified(ListCanceledPeer::APP_TITLE)) { + $criteria->add(ListCanceledPeer::APP_TITLE, $this->app_title); + } + + if ($this->isColumnModified(ListCanceledPeer::APP_PRO_TITLE)) { + $criteria->add(ListCanceledPeer::APP_PRO_TITLE, $this->app_pro_title); + } + + if ($this->isColumnModified(ListCanceledPeer::APP_TAS_TITLE)) { + $criteria->add(ListCanceledPeer::APP_TAS_TITLE, $this->app_tas_title); + } + + if ($this->isColumnModified(ListCanceledPeer::APP_CANCELED_DATE)) { + $criteria->add(ListCanceledPeer::APP_CANCELED_DATE, $this->app_canceled_date); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_INDEX)) { + $criteria->add(ListCanceledPeer::DEL_INDEX, $this->del_index); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_PREVIOUS_USR_UID)) { + $criteria->add(ListCanceledPeer::DEL_PREVIOUS_USR_UID, $this->del_previous_usr_uid); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_CURRENT_USR_USERNAME)) { + $criteria->add(ListCanceledPeer::DEL_CURRENT_USR_USERNAME, $this->del_current_usr_username); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME)) { + $criteria->add(ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME, $this->del_current_usr_firstname); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_CURRENT_USR_LASTNAME)) { + $criteria->add(ListCanceledPeer::DEL_CURRENT_USR_LASTNAME, $this->del_current_usr_lastname); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_DELEGATE_DATE)) { + $criteria->add(ListCanceledPeer::DEL_DELEGATE_DATE, $this->del_delegate_date); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_INIT_DATE)) { + $criteria->add(ListCanceledPeer::DEL_INIT_DATE, $this->del_init_date); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_DUE_DATE)) { + $criteria->add(ListCanceledPeer::DEL_DUE_DATE, $this->del_due_date); + } + + if ($this->isColumnModified(ListCanceledPeer::DEL_PRIORITY)) { + $criteria->add(ListCanceledPeer::DEL_PRIORITY, $this->del_priority); + } + + + 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(ListCanceledPeer::DATABASE_NAME); + + $criteria->add(ListCanceledPeer::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 ListCanceled (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->setUsrUid($this->usr_uid); + + $copyObj->setTasUid($this->tas_uid); + + $copyObj->setProUid($this->pro_uid); + + $copyObj->setAppNumber($this->app_number); + + $copyObj->setAppTitle($this->app_title); + + $copyObj->setAppProTitle($this->app_pro_title); + + $copyObj->setAppTasTitle($this->app_tas_title); + + $copyObj->setAppCanceledDate($this->app_canceled_date); + + $copyObj->setDelIndex($this->del_index); + + $copyObj->setDelPreviousUsrUid($this->del_previous_usr_uid); + + $copyObj->setDelCurrentUsrUsername($this->del_current_usr_username); + + $copyObj->setDelCurrentUsrFirstname($this->del_current_usr_firstname); + + $copyObj->setDelCurrentUsrLastname($this->del_current_usr_lastname); + + $copyObj->setDelDelegateDate($this->del_delegate_date); + + $copyObj->setDelInitDate($this->del_init_date); + + $copyObj->setDelDueDate($this->del_due_date); + + $copyObj->setDelPriority($this->del_priority); + + + $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 ListCanceled 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 ListCanceledPeer + */ + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new ListCanceledPeer(); + } + return self::$peer; + } +} + diff --git a/workflow/engine/classes/model/om/BaseListCanceledPeer.php b/workflow/engine/classes/model/om/BaseListCanceledPeer.php new file mode 100644 index 000000000..0ab6942a9 --- /dev/null +++ b/workflow/engine/classes/model/om/BaseListCanceledPeer.php @@ -0,0 +1,652 @@ + array ('AppUid', 'UsrUid', 'TasUid', 'ProUid', 'AppNumber', 'AppTitle', 'AppProTitle', 'AppTasTitle', 'AppCanceledDate', 'DelIndex', 'DelPreviousUsrUid', 'DelCurrentUsrUsername', 'DelCurrentUsrFirstname', 'DelCurrentUsrLastname', 'DelDelegateDate', 'DelInitDate', 'DelDueDate', 'DelPriority', ), + BasePeer::TYPE_COLNAME => array (ListCanceledPeer::APP_UID, ListCanceledPeer::USR_UID, ListCanceledPeer::TAS_UID, ListCanceledPeer::PRO_UID, ListCanceledPeer::APP_NUMBER, ListCanceledPeer::APP_TITLE, ListCanceledPeer::APP_PRO_TITLE, ListCanceledPeer::APP_TAS_TITLE, ListCanceledPeer::APP_CANCELED_DATE, ListCanceledPeer::DEL_INDEX, ListCanceledPeer::DEL_PREVIOUS_USR_UID, ListCanceledPeer::DEL_CURRENT_USR_USERNAME, ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME, ListCanceledPeer::DEL_CURRENT_USR_LASTNAME, ListCanceledPeer::DEL_DELEGATE_DATE, ListCanceledPeer::DEL_INIT_DATE, ListCanceledPeer::DEL_DUE_DATE, ListCanceledPeer::DEL_PRIORITY, ), + BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'USR_UID', 'TAS_UID', 'PRO_UID', 'APP_NUMBER', 'APP_TITLE', 'APP_PRO_TITLE', 'APP_TAS_TITLE', 'APP_CANCELED_DATE', 'DEL_INDEX', 'DEL_PREVIOUS_USR_UID', 'DEL_CURRENT_USR_USERNAME', 'DEL_CURRENT_USR_FIRSTNAME', 'DEL_CURRENT_USR_LASTNAME', 'DEL_DELEGATE_DATE', 'DEL_INIT_DATE', 'DEL_DUE_DATE', 'DEL_PRIORITY', ), + 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, 'UsrUid' => 1, 'TasUid' => 2, 'ProUid' => 3, 'AppNumber' => 4, 'AppTitle' => 5, 'AppProTitle' => 6, 'AppTasTitle' => 7, 'AppCanceledDate' => 8, 'DelIndex' => 9, 'DelPreviousUsrUid' => 10, 'DelCurrentUsrUsername' => 11, 'DelCurrentUsrFirstname' => 12, 'DelCurrentUsrLastname' => 13, 'DelDelegateDate' => 14, 'DelInitDate' => 15, 'DelDueDate' => 16, 'DelPriority' => 17, ), + BasePeer::TYPE_COLNAME => array (ListCanceledPeer::APP_UID => 0, ListCanceledPeer::USR_UID => 1, ListCanceledPeer::TAS_UID => 2, ListCanceledPeer::PRO_UID => 3, ListCanceledPeer::APP_NUMBER => 4, ListCanceledPeer::APP_TITLE => 5, ListCanceledPeer::APP_PRO_TITLE => 6, ListCanceledPeer::APP_TAS_TITLE => 7, ListCanceledPeer::APP_CANCELED_DATE => 8, ListCanceledPeer::DEL_INDEX => 9, ListCanceledPeer::DEL_PREVIOUS_USR_UID => 10, ListCanceledPeer::DEL_CURRENT_USR_USERNAME => 11, ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME => 12, ListCanceledPeer::DEL_CURRENT_USR_LASTNAME => 13, ListCanceledPeer::DEL_DELEGATE_DATE => 14, ListCanceledPeer::DEL_INIT_DATE => 15, ListCanceledPeer::DEL_DUE_DATE => 16, ListCanceledPeer::DEL_PRIORITY => 17, ), + BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'USR_UID' => 1, 'TAS_UID' => 2, 'PRO_UID' => 3, 'APP_NUMBER' => 4, 'APP_TITLE' => 5, 'APP_PRO_TITLE' => 6, 'APP_TAS_TITLE' => 7, 'APP_CANCELED_DATE' => 8, 'DEL_INDEX' => 9, 'DEL_PREVIOUS_USR_UID' => 10, 'DEL_CURRENT_USR_USERNAME' => 11, 'DEL_CURRENT_USR_FIRSTNAME' => 12, 'DEL_CURRENT_USR_LASTNAME' => 13, 'DEL_DELEGATE_DATE' => 14, 'DEL_INIT_DATE' => 15, 'DEL_DUE_DATE' => 16, 'DEL_PRIORITY' => 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/ListCanceledMapBuilder.php'; + return BasePeer::getMapBuilder('classes.model.map.ListCanceledMapBuilder'); + } + /** + * 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 = ListCanceledPeer::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. ListCanceledPeer::COLUMN_NAME). + * @return string + */ + public static function alias($alias, $column) + { + return str_replace(ListCanceledPeer::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(ListCanceledPeer::APP_UID); + + $criteria->addSelectColumn(ListCanceledPeer::USR_UID); + + $criteria->addSelectColumn(ListCanceledPeer::TAS_UID); + + $criteria->addSelectColumn(ListCanceledPeer::PRO_UID); + + $criteria->addSelectColumn(ListCanceledPeer::APP_NUMBER); + + $criteria->addSelectColumn(ListCanceledPeer::APP_TITLE); + + $criteria->addSelectColumn(ListCanceledPeer::APP_PRO_TITLE); + + $criteria->addSelectColumn(ListCanceledPeer::APP_TAS_TITLE); + + $criteria->addSelectColumn(ListCanceledPeer::APP_CANCELED_DATE); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_INDEX); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_PREVIOUS_USR_UID); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_CURRENT_USR_USERNAME); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_CURRENT_USR_LASTNAME); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_DELEGATE_DATE); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_INIT_DATE); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_DUE_DATE); + + $criteria->addSelectColumn(ListCanceledPeer::DEL_PRIORITY); + + } + + const COUNT = 'COUNT(LIST_CANCELED.APP_UID)'; + const COUNT_DISTINCT = 'COUNT(DISTINCT LIST_CANCELED.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(ListCanceledPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(ListCanceledPeer::COUNT); + } + + // just in case we're grouping: add those columns to the select statement + foreach ($criteria->getGroupByColumns() as $column) { + $criteria->addSelectColumn($column); + } + + $rs = ListCanceledPeer::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 ListCanceled + * @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 = ListCanceledPeer::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 ListCanceledPeer::populateObjects(ListCanceledPeer::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; + ListCanceledPeer::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 = ListCanceledPeer::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 ListCanceledPeer::CLASS_DEFAULT; + } + + /** + * Method perform an INSERT on the database, given a ListCanceled or Criteria object. + * + * @param mixed $values Criteria or ListCanceled 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 ListCanceled 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 ListCanceled or Criteria object. + * + * @param mixed $values Criteria or ListCanceled 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(ListCanceledPeer::APP_UID); + $selectCriteria->add(ListCanceledPeer::APP_UID, $criteria->remove(ListCanceledPeer::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 LIST_CANCELED 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(ListCanceledPeer::TABLE_NAME, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + /** + * Method perform a DELETE on the database, given a ListCanceled or Criteria object OR a primary key value. + * + * @param mixed $values Criteria or ListCanceled 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(ListCanceledPeer::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + } elseif ($values instanceof ListCanceled) { + + $criteria = $values->buildPkeyCriteria(); + } else { + // it must be the primary key + $criteria = new Criteria(self::DATABASE_NAME); + $criteria->add(ListCanceledPeer::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 ListCanceled 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 ListCanceled $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(ListCanceled $obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(ListCanceledPeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(ListCanceledPeer::TABLE_NAME); + + if (! is_array($cols)) { + $cols = array($cols); + } + + foreach ($cols as $colName) { + if ($tableMap->containsColumn($colName)) { + $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); + $columns[$colName] = $obj->$get(); + } + } + } else { + + } + + return BasePeer::doValidate(ListCanceledPeer::DATABASE_NAME, ListCanceledPeer::TABLE_NAME, $columns); + } + + /** + * Retrieve a single object by pkey. + * + * @param mixed $pk the primary key. + * @param Connection $con the connection to use + * @return ListCanceled + */ + public static function retrieveByPK($pk, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + + $criteria = new Criteria(ListCanceledPeer::DATABASE_NAME); + + $criteria->add(ListCanceledPeer::APP_UID, $pk); + + + $v = ListCanceledPeer::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(ListCanceledPeer::APP_UID, $pks, Criteria::IN); + $objs = ListCanceledPeer::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 { + BaseListCanceledPeer::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/ListCanceledMapBuilder.php'; + Propel::registerMapBuilder('classes.model.map.ListCanceledMapBuilder'); +} + diff --git a/workflow/engine/classes/model/om/BaseListPaused.php b/workflow/engine/classes/model/om/BaseListPaused.php new file mode 100644 index 000000000..719232659 --- /dev/null +++ b/workflow/engine/classes/model/om/BaseListPaused.php @@ -0,0 +1,1648 @@ +app_uid; + } + + /** + * Get the [del_index] column value. + * + * @return int + */ + public function getDelIndex() + { + + return $this->del_index; + } + + /** + * Get the [usr_uid] column value. + * + * @return string + */ + public function getUsrUid() + { + + return $this->usr_uid; + } + + /** + * Get the [tas_uid] column value. + * + * @return string + */ + public function getTasUid() + { + + return $this->tas_uid; + } + + /** + * Get the [pro_uid] column value. + * + * @return string + */ + public function getProUid() + { + + return $this->pro_uid; + } + + /** + * Get the [app_number] column value. + * + * @return int + */ + public function getAppNumber() + { + + return $this->app_number; + } + + /** + * Get the [app_title] column value. + * + * @return string + */ + public function getAppTitle() + { + + return $this->app_title; + } + + /** + * Get the [app_pro_title] column value. + * + * @return string + */ + public function getAppProTitle() + { + + return $this->app_pro_title; + } + + /** + * Get the [app_tas_title] column value. + * + * @return string + */ + public function getAppTasTitle() + { + + return $this->app_tas_title; + } + + /** + * Get the [optionally formatted] [app_paused_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 getAppPausedDate($format = 'Y-m-d H:i:s') + { + + if ($this->app_paused_date === null || $this->app_paused_date === '') { + return null; + } elseif (!is_int($this->app_paused_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->app_paused_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [app_paused_date] as date/time value: " . + var_export($this->app_paused_date, true)); + } + } else { + $ts = $this->app_paused_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [optionally formatted] [app_restart_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 getAppRestartDate($format = 'Y-m-d H:i:s') + { + + if ($this->app_restart_date === null || $this->app_restart_date === '') { + return null; + } elseif (!is_int($this->app_restart_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->app_restart_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [app_restart_date] as date/time value: " . + var_export($this->app_restart_date, true)); + } + } else { + $ts = $this->app_restart_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [del_current_usr_username] column value. + * + * @return string + */ + public function getDelCurrentUsrUsername() + { + + return $this->del_current_usr_username; + } + + /** + * Get the [del_current_usr_firstname] column value. + * + * @return string + */ + public function getDelCurrentUsrFirstname() + { + + return $this->del_current_usr_firstname; + } + + /** + * Get the [del_current_usr_lastname] column value. + * + * @return string + */ + public function getDelCurrentUsrLastname() + { + + return $this->del_current_usr_lastname; + } + + /** + * Get the [optionally formatted] [del_delegate_date] column value. + * + * @param string $format The date/time format string (either date()-style or strftime()-style). + * If format is NULL, then the integer unix timestamp will be returned. + * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL). + * @throws PropelException - if unable to convert the date/time to timestamp. + */ + public function getDelDelegateDate($format = 'Y-m-d H:i:s') + { + + if ($this->del_delegate_date === null || $this->del_delegate_date === '') { + return null; + } elseif (!is_int($this->del_delegate_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->del_delegate_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [del_delegate_date] as date/time value: " . + var_export($this->del_delegate_date, true)); + } + } else { + $ts = $this->del_delegate_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [optionally formatted] [del_init_date] column value. + * + * @param string $format The date/time format string (either date()-style or strftime()-style). + * If format is NULL, then the integer unix timestamp will be returned. + * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL). + * @throws PropelException - if unable to convert the date/time to timestamp. + */ + public function getDelInitDate($format = 'Y-m-d H:i:s') + { + + if ($this->del_init_date === null || $this->del_init_date === '') { + return null; + } elseif (!is_int($this->del_init_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->del_init_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [del_init_date] as date/time value: " . + var_export($this->del_init_date, true)); + } + } else { + $ts = $this->del_init_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [optionally formatted] [del_due_date] column value. + * + * @param string $format The date/time format string (either date()-style or strftime()-style). + * If format is NULL, then the integer unix timestamp will be returned. + * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL). + * @throws PropelException - if unable to convert the date/time to timestamp. + */ + public function getDelDueDate($format = 'Y-m-d H:i:s') + { + + if ($this->del_due_date === null || $this->del_due_date === '') { + return null; + } elseif (!is_int($this->del_due_date)) { + // a non-timestamp value was set externally, so we convert it + $ts = strtotime($this->del_due_date); + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse value of [del_due_date] as date/time value: " . + var_export($this->del_due_date, true)); + } + } else { + $ts = $this->del_due_date; + } + if ($format === null) { + return $ts; + } elseif (strpos($format, '%') !== false) { + return strftime($format, $ts); + } else { + return date($format, $ts); + } + } + + /** + * Get the [del_priority] column value. + * + * @return string + */ + public function getDelPriority() + { + + return $this->del_priority; + } + + /** + * 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[] = ListPausedPeer::APP_UID; + } + + } // setAppUid() + + /** + * Set the value of [del_index] column. + * + * @param int $v new value + * @return void + */ + public function setDelIndex($v) + { + + // Since the native PHP type for this column is integer, + // we will cast the input value to an int (if it is not). + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->del_index !== $v || $v === 0) { + $this->del_index = $v; + $this->modifiedColumns[] = ListPausedPeer::DEL_INDEX; + } + + } // setDelIndex() + + /** + * Set the value of [usr_uid] column. + * + * @param string $v new value + * @return void + */ + public function setUsrUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->usr_uid !== $v || $v === '') { + $this->usr_uid = $v; + $this->modifiedColumns[] = ListPausedPeer::USR_UID; + } + + } // setUsrUid() + + /** + * Set the value of [tas_uid] column. + * + * @param string $v new value + * @return void + */ + public function setTasUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->tas_uid !== $v || $v === '') { + $this->tas_uid = $v; + $this->modifiedColumns[] = ListPausedPeer::TAS_UID; + } + + } // setTasUid() + + /** + * Set the value of [pro_uid] column. + * + * @param string $v new value + * @return void + */ + public function setProUid($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->pro_uid !== $v || $v === '') { + $this->pro_uid = $v; + $this->modifiedColumns[] = ListPausedPeer::PRO_UID; + } + + } // setProUid() + + /** + * 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[] = ListPausedPeer::APP_NUMBER; + } + + } // setAppNumber() + + /** + * Set the value of [app_title] column. + * + * @param string $v new value + * @return void + */ + public function setAppTitle($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->app_title !== $v || $v === '') { + $this->app_title = $v; + $this->modifiedColumns[] = ListPausedPeer::APP_TITLE; + } + + } // setAppTitle() + + /** + * Set the value of [app_pro_title] column. + * + * @param string $v new value + * @return void + */ + public function setAppProTitle($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->app_pro_title !== $v || $v === '') { + $this->app_pro_title = $v; + $this->modifiedColumns[] = ListPausedPeer::APP_PRO_TITLE; + } + + } // setAppProTitle() + + /** + * Set the value of [app_tas_title] column. + * + * @param string $v new value + * @return void + */ + public function setAppTasTitle($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->app_tas_title !== $v || $v === '') { + $this->app_tas_title = $v; + $this->modifiedColumns[] = ListPausedPeer::APP_TAS_TITLE; + } + + } // setAppTasTitle() + + /** + * Set the value of [app_paused_date] column. + * + * @param int $v new value + * @return void + */ + public function setAppPausedDate($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_paused_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->app_paused_date !== $ts) { + $this->app_paused_date = $ts; + $this->modifiedColumns[] = ListPausedPeer::APP_PAUSED_DATE; + } + + } // setAppPausedDate() + + /** + * Set the value of [app_restart_date] column. + * + * @param int $v new value + * @return void + */ + public function setAppRestartDate($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_restart_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->app_restart_date !== $ts) { + $this->app_restart_date = $ts; + $this->modifiedColumns[] = ListPausedPeer::APP_RESTART_DATE; + } + + } // setAppRestartDate() + + /** + * Set the value of [del_current_usr_username] column. + * + * @param string $v new value + * @return void + */ + public function setDelCurrentUsrUsername($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_current_usr_username !== $v || $v === '') { + $this->del_current_usr_username = $v; + $this->modifiedColumns[] = ListPausedPeer::DEL_CURRENT_USR_USERNAME; + } + + } // setDelCurrentUsrUsername() + + /** + * Set the value of [del_current_usr_firstname] column. + * + * @param string $v new value + * @return void + */ + public function setDelCurrentUsrFirstname($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_current_usr_firstname !== $v || $v === '') { + $this->del_current_usr_firstname = $v; + $this->modifiedColumns[] = ListPausedPeer::DEL_CURRENT_USR_FIRSTNAME; + } + + } // setDelCurrentUsrFirstname() + + /** + * Set the value of [del_current_usr_lastname] column. + * + * @param string $v new value + * @return void + */ + public function setDelCurrentUsrLastname($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_current_usr_lastname !== $v || $v === '') { + $this->del_current_usr_lastname = $v; + $this->modifiedColumns[] = ListPausedPeer::DEL_CURRENT_USR_LASTNAME; + } + + } // setDelCurrentUsrLastname() + + /** + * Set the value of [del_delegate_date] column. + * + * @param int $v new value + * @return void + */ + public function setDelDelegateDate($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse date/time value for [del_delegate_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->del_delegate_date !== $ts) { + $this->del_delegate_date = $ts; + $this->modifiedColumns[] = ListPausedPeer::DEL_DELEGATE_DATE; + } + + } // setDelDelegateDate() + + /** + * Set the value of [del_init_date] column. + * + * @param int $v new value + * @return void + */ + public function setDelInitDate($v) + { + + if ($v !== null && !is_int($v)) { + $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } + if ($ts === -1 || $ts === false) { + throw new PropelException("Unable to parse date/time value for [del_init_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->del_init_date !== $ts) { + $this->del_init_date = $ts; + $this->modifiedColumns[] = ListPausedPeer::DEL_INIT_DATE; + } + + } // setDelInitDate() + + /** + * Set the value of [del_due_date] column. + * + * @param int $v new value + * @return void + */ + public function setDelDueDate($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 [del_due_date] from input: " . + var_export($v, true)); + } + } else { + $ts = $v; + } + if ($this->del_due_date !== $ts) { + $this->del_due_date = $ts; + $this->modifiedColumns[] = ListPausedPeer::DEL_DUE_DATE; + } + + } // setDelDueDate() + + /** + * Set the value of [del_priority] column. + * + * @param string $v new value + * @return void + */ + public function setDelPriority($v) + { + + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; + } + + if ($this->del_priority !== $v || $v === '3') { + $this->del_priority = $v; + $this->modifiedColumns[] = ListPausedPeer::DEL_PRIORITY; + } + + } // setDelPriority() + + /** + * Hydrates (populates) the object variables with values from the database resultset. + * + * An offset (1-based "start column") is specified so that objects can be hydrated + * with a subset of the columns in the resultset rows. This is needed, for example, + * for results of JOIN queries where the resultset row includes columns from two or + * more tables. + * + * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos. + * @param int $startcol 1-based offset column which indicates which restultset column to start with. + * @return int next starting column + * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. + */ + public function hydrate(ResultSet $rs, $startcol = 1) + { + try { + + $this->app_uid = $rs->getString($startcol + 0); + + $this->del_index = $rs->getInt($startcol + 1); + + $this->usr_uid = $rs->getString($startcol + 2); + + $this->tas_uid = $rs->getString($startcol + 3); + + $this->pro_uid = $rs->getString($startcol + 4); + + $this->app_number = $rs->getInt($startcol + 5); + + $this->app_title = $rs->getString($startcol + 6); + + $this->app_pro_title = $rs->getString($startcol + 7); + + $this->app_tas_title = $rs->getString($startcol + 8); + + $this->app_paused_date = $rs->getTimestamp($startcol + 9, null); + + $this->app_restart_date = $rs->getTimestamp($startcol + 10, null); + + $this->del_current_usr_username = $rs->getString($startcol + 11); + + $this->del_current_usr_firstname = $rs->getString($startcol + 12); + + $this->del_current_usr_lastname = $rs->getString($startcol + 13); + + $this->del_delegate_date = $rs->getTimestamp($startcol + 14, null); + + $this->del_init_date = $rs->getTimestamp($startcol + 15, null); + + $this->del_due_date = $rs->getTimestamp($startcol + 16, null); + + $this->del_priority = $rs->getString($startcol + 17); + + $this->resetModified(); + + $this->setNew(false); + + // FIXME - using NUM_COLUMNS may be clearer. + return $startcol + 18; // 18 = ListPausedPeer::NUM_COLUMNS - ListPausedPeer::NUM_LAZY_LOAD_COLUMNS). + + } catch (Exception $e) { + throw new PropelException("Error populating ListPaused 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(ListPausedPeer::DATABASE_NAME); + } + + try { + $con->begin(); + ListPausedPeer::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(ListPausedPeer::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 = ListPausedPeer::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 += ListPausedPeer::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 = ListPausedPeer::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 = ListPausedPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->getByPosition($pos); + } + + /** + * Retrieves a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @return mixed Value of field at $pos + */ + public function getByPosition($pos) + { + switch($pos) { + case 0: + return $this->getAppUid(); + break; + case 1: + return $this->getDelIndex(); + break; + case 2: + return $this->getUsrUid(); + break; + case 3: + return $this->getTasUid(); + break; + case 4: + return $this->getProUid(); + break; + case 5: + return $this->getAppNumber(); + break; + case 6: + return $this->getAppTitle(); + break; + case 7: + return $this->getAppProTitle(); + break; + case 8: + return $this->getAppTasTitle(); + break; + case 9: + return $this->getAppPausedDate(); + break; + case 10: + return $this->getAppRestartDate(); + break; + case 11: + return $this->getDelCurrentUsrUsername(); + break; + case 12: + return $this->getDelCurrentUsrFirstname(); + break; + case 13: + return $this->getDelCurrentUsrLastname(); + break; + case 14: + return $this->getDelDelegateDate(); + break; + case 15: + return $this->getDelInitDate(); + break; + case 16: + return $this->getDelDueDate(); + break; + case 17: + return $this->getDelPriority(); + 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 = ListPausedPeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getAppUid(), + $keys[1] => $this->getDelIndex(), + $keys[2] => $this->getUsrUid(), + $keys[3] => $this->getTasUid(), + $keys[4] => $this->getProUid(), + $keys[5] => $this->getAppNumber(), + $keys[6] => $this->getAppTitle(), + $keys[7] => $this->getAppProTitle(), + $keys[8] => $this->getAppTasTitle(), + $keys[9] => $this->getAppPausedDate(), + $keys[10] => $this->getAppRestartDate(), + $keys[11] => $this->getDelCurrentUsrUsername(), + $keys[12] => $this->getDelCurrentUsrFirstname(), + $keys[13] => $this->getDelCurrentUsrLastname(), + $keys[14] => $this->getDelDelegateDate(), + $keys[15] => $this->getDelInitDate(), + $keys[16] => $this->getDelDueDate(), + $keys[17] => $this->getDelPriority(), + ); + 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 = ListPausedPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->setByPosition($pos, $value); + } + + /** + * Sets a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @param mixed $value field value + * @return void + */ + public function setByPosition($pos, $value) + { + switch($pos) { + case 0: + $this->setAppUid($value); + break; + case 1: + $this->setDelIndex($value); + break; + case 2: + $this->setUsrUid($value); + break; + case 3: + $this->setTasUid($value); + break; + case 4: + $this->setProUid($value); + break; + case 5: + $this->setAppNumber($value); + break; + case 6: + $this->setAppTitle($value); + break; + case 7: + $this->setAppProTitle($value); + break; + case 8: + $this->setAppTasTitle($value); + break; + case 9: + $this->setAppPausedDate($value); + break; + case 10: + $this->setAppRestartDate($value); + break; + case 11: + $this->setDelCurrentUsrUsername($value); + break; + case 12: + $this->setDelCurrentUsrFirstname($value); + break; + case 13: + $this->setDelCurrentUsrLastname($value); + break; + case 14: + $this->setDelDelegateDate($value); + break; + case 15: + $this->setDelInitDate($value); + break; + case 16: + $this->setDelDueDate($value); + break; + case 17: + $this->setDelPriority($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 = ListPausedPeer::getFieldNames($keyType); + + if (array_key_exists($keys[0], $arr)) { + $this->setAppUid($arr[$keys[0]]); + } + + if (array_key_exists($keys[1], $arr)) { + $this->setDelIndex($arr[$keys[1]]); + } + + if (array_key_exists($keys[2], $arr)) { + $this->setUsrUid($arr[$keys[2]]); + } + + if (array_key_exists($keys[3], $arr)) { + $this->setTasUid($arr[$keys[3]]); + } + + if (array_key_exists($keys[4], $arr)) { + $this->setProUid($arr[$keys[4]]); + } + + if (array_key_exists($keys[5], $arr)) { + $this->setAppNumber($arr[$keys[5]]); + } + + if (array_key_exists($keys[6], $arr)) { + $this->setAppTitle($arr[$keys[6]]); + } + + if (array_key_exists($keys[7], $arr)) { + $this->setAppProTitle($arr[$keys[7]]); + } + + if (array_key_exists($keys[8], $arr)) { + $this->setAppTasTitle($arr[$keys[8]]); + } + + if (array_key_exists($keys[9], $arr)) { + $this->setAppPausedDate($arr[$keys[9]]); + } + + if (array_key_exists($keys[10], $arr)) { + $this->setAppRestartDate($arr[$keys[10]]); + } + + if (array_key_exists($keys[11], $arr)) { + $this->setDelCurrentUsrUsername($arr[$keys[11]]); + } + + if (array_key_exists($keys[12], $arr)) { + $this->setDelCurrentUsrFirstname($arr[$keys[12]]); + } + + if (array_key_exists($keys[13], $arr)) { + $this->setDelCurrentUsrLastname($arr[$keys[13]]); + } + + if (array_key_exists($keys[14], $arr)) { + $this->setDelDelegateDate($arr[$keys[14]]); + } + + if (array_key_exists($keys[15], $arr)) { + $this->setDelInitDate($arr[$keys[15]]); + } + + if (array_key_exists($keys[16], $arr)) { + $this->setDelDueDate($arr[$keys[16]]); + } + + if (array_key_exists($keys[17], $arr)) { + $this->setDelPriority($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(ListPausedPeer::DATABASE_NAME); + + if ($this->isColumnModified(ListPausedPeer::APP_UID)) { + $criteria->add(ListPausedPeer::APP_UID, $this->app_uid); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_INDEX)) { + $criteria->add(ListPausedPeer::DEL_INDEX, $this->del_index); + } + + if ($this->isColumnModified(ListPausedPeer::USR_UID)) { + $criteria->add(ListPausedPeer::USR_UID, $this->usr_uid); + } + + if ($this->isColumnModified(ListPausedPeer::TAS_UID)) { + $criteria->add(ListPausedPeer::TAS_UID, $this->tas_uid); + } + + if ($this->isColumnModified(ListPausedPeer::PRO_UID)) { + $criteria->add(ListPausedPeer::PRO_UID, $this->pro_uid); + } + + if ($this->isColumnModified(ListPausedPeer::APP_NUMBER)) { + $criteria->add(ListPausedPeer::APP_NUMBER, $this->app_number); + } + + if ($this->isColumnModified(ListPausedPeer::APP_TITLE)) { + $criteria->add(ListPausedPeer::APP_TITLE, $this->app_title); + } + + if ($this->isColumnModified(ListPausedPeer::APP_PRO_TITLE)) { + $criteria->add(ListPausedPeer::APP_PRO_TITLE, $this->app_pro_title); + } + + if ($this->isColumnModified(ListPausedPeer::APP_TAS_TITLE)) { + $criteria->add(ListPausedPeer::APP_TAS_TITLE, $this->app_tas_title); + } + + if ($this->isColumnModified(ListPausedPeer::APP_PAUSED_DATE)) { + $criteria->add(ListPausedPeer::APP_PAUSED_DATE, $this->app_paused_date); + } + + if ($this->isColumnModified(ListPausedPeer::APP_RESTART_DATE)) { + $criteria->add(ListPausedPeer::APP_RESTART_DATE, $this->app_restart_date); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_CURRENT_USR_USERNAME)) { + $criteria->add(ListPausedPeer::DEL_CURRENT_USR_USERNAME, $this->del_current_usr_username); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_CURRENT_USR_FIRSTNAME)) { + $criteria->add(ListPausedPeer::DEL_CURRENT_USR_FIRSTNAME, $this->del_current_usr_firstname); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_CURRENT_USR_LASTNAME)) { + $criteria->add(ListPausedPeer::DEL_CURRENT_USR_LASTNAME, $this->del_current_usr_lastname); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_DELEGATE_DATE)) { + $criteria->add(ListPausedPeer::DEL_DELEGATE_DATE, $this->del_delegate_date); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_INIT_DATE)) { + $criteria->add(ListPausedPeer::DEL_INIT_DATE, $this->del_init_date); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_DUE_DATE)) { + $criteria->add(ListPausedPeer::DEL_DUE_DATE, $this->del_due_date); + } + + if ($this->isColumnModified(ListPausedPeer::DEL_PRIORITY)) { + $criteria->add(ListPausedPeer::DEL_PRIORITY, $this->del_priority); + } + + + 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(ListPausedPeer::DATABASE_NAME); + + $criteria->add(ListPausedPeer::APP_UID, $this->app_uid); + $criteria->add(ListPausedPeer::DEL_INDEX, $this->del_index); + + return $criteria; + } + + /** + * Returns the composite primary key for this object. + * The array elements will be in same order as specified in XML. + * @return array + */ + public function getPrimaryKey() + { + $pks = array(); + + $pks[0] = $this->getAppUid(); + + $pks[1] = $this->getDelIndex(); + + return $pks; + } + + /** + * Set the [composite] primary key. + * + * @param array $keys The elements of the composite key (order must match the order in XML file). + * @return void + */ + public function setPrimaryKey($keys) + { + + $this->setAppUid($keys[0]); + + $this->setDelIndex($keys[1]); + + } + + /** + * Sets contents of passed object to values from current object. + * + * If desired, this method can also make copies of all associated (fkey referrers) + * objects. + * + * @param object $copyObj An object of ListPaused (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->setUsrUid($this->usr_uid); + + $copyObj->setTasUid($this->tas_uid); + + $copyObj->setProUid($this->pro_uid); + + $copyObj->setAppNumber($this->app_number); + + $copyObj->setAppTitle($this->app_title); + + $copyObj->setAppProTitle($this->app_pro_title); + + $copyObj->setAppTasTitle($this->app_tas_title); + + $copyObj->setAppPausedDate($this->app_paused_date); + + $copyObj->setAppRestartDate($this->app_restart_date); + + $copyObj->setDelCurrentUsrUsername($this->del_current_usr_username); + + $copyObj->setDelCurrentUsrFirstname($this->del_current_usr_firstname); + + $copyObj->setDelCurrentUsrLastname($this->del_current_usr_lastname); + + $copyObj->setDelDelegateDate($this->del_delegate_date); + + $copyObj->setDelInitDate($this->del_init_date); + + $copyObj->setDelDueDate($this->del_due_date); + + $copyObj->setDelPriority($this->del_priority); + + + $copyObj->setNew(true); + + $copyObj->setAppUid(''); // this is a pkey column, so set to default value + + $copyObj->setDelIndex('0'); // this is a pkey column, so set to default value + + } + + /** + * Makes a copy of this object that will be inserted as a new row in table when saved. + * It creates a new object filling in the simple attributes, but skipping any primary + * keys that are defined for the table. + * + * If desired, this method can also make copies of all associated (fkey referrers) + * objects. + * + * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. + * @return ListPaused 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 ListPausedPeer + */ + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new ListPausedPeer(); + } + return self::$peer; + } +} + diff --git a/workflow/engine/classes/model/om/BaseListPausedPeer.php b/workflow/engine/classes/model/om/BaseListPausedPeer.php new file mode 100644 index 000000000..b62ca915c --- /dev/null +++ b/workflow/engine/classes/model/om/BaseListPausedPeer.php @@ -0,0 +1,642 @@ + array ('AppUid', 'DelIndex', 'UsrUid', 'TasUid', 'ProUid', 'AppNumber', 'AppTitle', 'AppProTitle', 'AppTasTitle', 'AppPausedDate', 'AppRestartDate', 'DelCurrentUsrUsername', 'DelCurrentUsrFirstname', 'DelCurrentUsrLastname', 'DelDelegateDate', 'DelInitDate', 'DelDueDate', 'DelPriority', ), + BasePeer::TYPE_COLNAME => array (ListPausedPeer::APP_UID, ListPausedPeer::DEL_INDEX, ListPausedPeer::USR_UID, ListPausedPeer::TAS_UID, ListPausedPeer::PRO_UID, ListPausedPeer::APP_NUMBER, ListPausedPeer::APP_TITLE, ListPausedPeer::APP_PRO_TITLE, ListPausedPeer::APP_TAS_TITLE, ListPausedPeer::APP_PAUSED_DATE, ListPausedPeer::APP_RESTART_DATE, ListPausedPeer::DEL_CURRENT_USR_USERNAME, ListPausedPeer::DEL_CURRENT_USR_FIRSTNAME, ListPausedPeer::DEL_CURRENT_USR_LASTNAME, ListPausedPeer::DEL_DELEGATE_DATE, ListPausedPeer::DEL_INIT_DATE, ListPausedPeer::DEL_DUE_DATE, ListPausedPeer::DEL_PRIORITY, ), + BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'DEL_INDEX', 'USR_UID', 'TAS_UID', 'PRO_UID', 'APP_NUMBER', 'APP_TITLE', 'APP_PRO_TITLE', 'APP_TAS_TITLE', 'APP_PAUSED_DATE', 'APP_RESTART_DATE', 'DEL_CURRENT_USR_USERNAME', 'DEL_CURRENT_USR_FIRSTNAME', 'DEL_CURRENT_USR_LASTNAME', 'DEL_DELEGATE_DATE', 'DEL_INIT_DATE', 'DEL_DUE_DATE', 'DEL_PRIORITY', ), + 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, 'DelIndex' => 1, 'UsrUid' => 2, 'TasUid' => 3, 'ProUid' => 4, 'AppNumber' => 5, 'AppTitle' => 6, 'AppProTitle' => 7, 'AppTasTitle' => 8, 'AppPausedDate' => 9, 'AppRestartDate' => 10, 'DelCurrentUsrUsername' => 11, 'DelCurrentUsrFirstname' => 12, 'DelCurrentUsrLastname' => 13, 'DelDelegateDate' => 14, 'DelInitDate' => 15, 'DelDueDate' => 16, 'DelPriority' => 17, ), + BasePeer::TYPE_COLNAME => array (ListPausedPeer::APP_UID => 0, ListPausedPeer::DEL_INDEX => 1, ListPausedPeer::USR_UID => 2, ListPausedPeer::TAS_UID => 3, ListPausedPeer::PRO_UID => 4, ListPausedPeer::APP_NUMBER => 5, ListPausedPeer::APP_TITLE => 6, ListPausedPeer::APP_PRO_TITLE => 7, ListPausedPeer::APP_TAS_TITLE => 8, ListPausedPeer::APP_PAUSED_DATE => 9, ListPausedPeer::APP_RESTART_DATE => 10, ListPausedPeer::DEL_CURRENT_USR_USERNAME => 11, ListPausedPeer::DEL_CURRENT_USR_FIRSTNAME => 12, ListPausedPeer::DEL_CURRENT_USR_LASTNAME => 13, ListPausedPeer::DEL_DELEGATE_DATE => 14, ListPausedPeer::DEL_INIT_DATE => 15, ListPausedPeer::DEL_DUE_DATE => 16, ListPausedPeer::DEL_PRIORITY => 17, ), + BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'DEL_INDEX' => 1, 'USR_UID' => 2, 'TAS_UID' => 3, 'PRO_UID' => 4, 'APP_NUMBER' => 5, 'APP_TITLE' => 6, 'APP_PRO_TITLE' => 7, 'APP_TAS_TITLE' => 8, 'APP_PAUSED_DATE' => 9, 'APP_RESTART_DATE' => 10, 'DEL_CURRENT_USR_USERNAME' => 11, 'DEL_CURRENT_USR_FIRSTNAME' => 12, 'DEL_CURRENT_USR_LASTNAME' => 13, 'DEL_DELEGATE_DATE' => 14, 'DEL_INIT_DATE' => 15, 'DEL_DUE_DATE' => 16, 'DEL_PRIORITY' => 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/ListPausedMapBuilder.php'; + return BasePeer::getMapBuilder('classes.model.map.ListPausedMapBuilder'); + } + /** + * 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 = ListPausedPeer::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. ListPausedPeer::COLUMN_NAME). + * @return string + */ + public static function alias($alias, $column) + { + return str_replace(ListPausedPeer::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(ListPausedPeer::APP_UID); + + $criteria->addSelectColumn(ListPausedPeer::DEL_INDEX); + + $criteria->addSelectColumn(ListPausedPeer::USR_UID); + + $criteria->addSelectColumn(ListPausedPeer::TAS_UID); + + $criteria->addSelectColumn(ListPausedPeer::PRO_UID); + + $criteria->addSelectColumn(ListPausedPeer::APP_NUMBER); + + $criteria->addSelectColumn(ListPausedPeer::APP_TITLE); + + $criteria->addSelectColumn(ListPausedPeer::APP_PRO_TITLE); + + $criteria->addSelectColumn(ListPausedPeer::APP_TAS_TITLE); + + $criteria->addSelectColumn(ListPausedPeer::APP_PAUSED_DATE); + + $criteria->addSelectColumn(ListPausedPeer::APP_RESTART_DATE); + + $criteria->addSelectColumn(ListPausedPeer::DEL_CURRENT_USR_USERNAME); + + $criteria->addSelectColumn(ListPausedPeer::DEL_CURRENT_USR_FIRSTNAME); + + $criteria->addSelectColumn(ListPausedPeer::DEL_CURRENT_USR_LASTNAME); + + $criteria->addSelectColumn(ListPausedPeer::DEL_DELEGATE_DATE); + + $criteria->addSelectColumn(ListPausedPeer::DEL_INIT_DATE); + + $criteria->addSelectColumn(ListPausedPeer::DEL_DUE_DATE); + + $criteria->addSelectColumn(ListPausedPeer::DEL_PRIORITY); + + } + + const COUNT = 'COUNT(LIST_PAUSED.APP_UID)'; + const COUNT_DISTINCT = 'COUNT(DISTINCT LIST_PAUSED.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(ListPausedPeer::COUNT_DISTINCT); + } else { + $criteria->addSelectColumn(ListPausedPeer::COUNT); + } + + // just in case we're grouping: add those columns to the select statement + foreach ($criteria->getGroupByColumns() as $column) { + $criteria->addSelectColumn($column); + } + + $rs = ListPausedPeer::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 ListPaused + * @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 = ListPausedPeer::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 ListPausedPeer::populateObjects(ListPausedPeer::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; + ListPausedPeer::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 = ListPausedPeer::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 ListPausedPeer::CLASS_DEFAULT; + } + + /** + * Method perform an INSERT on the database, given a ListPaused or Criteria object. + * + * @param mixed $values Criteria or ListPaused 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 ListPaused 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 ListPaused or Criteria object. + * + * @param mixed $values Criteria or ListPaused 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(ListPausedPeer::APP_UID); + $selectCriteria->add(ListPausedPeer::APP_UID, $criteria->remove(ListPausedPeer::APP_UID), $comparison); + + $comparison = $criteria->getComparison(ListPausedPeer::DEL_INDEX); + $selectCriteria->add(ListPausedPeer::DEL_INDEX, $criteria->remove(ListPausedPeer::DEL_INDEX), $comparison); + + } else { + $criteria = $values->buildCriteria(); // gets full criteria + $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s) + } + + // set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + return BasePeer::doUpdate($selectCriteria, $criteria, $con); + } + + /** + * Method to DELETE all rows from the LIST_PAUSED 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(ListPausedPeer::TABLE_NAME, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + /** + * Method perform a DELETE on the database, given a ListPaused or Criteria object OR a primary key value. + * + * @param mixed $values Criteria or ListPaused 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(ListPausedPeer::DATABASE_NAME); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + } elseif ($values instanceof ListPaused) { + + $criteria = $values->buildPkeyCriteria(); + } else { + // it must be the primary key + $criteria = new Criteria(self::DATABASE_NAME); + // primary key is composite; we therefore, expect + // the primary key passed to be an array of pkey + // values + if (count($values) == count($values, COUNT_RECURSIVE)) { + // array is not multi-dimensional + $values = array($values); + } + $vals = array(); + foreach ($values as $value) { + + $vals[0][] = $value[0]; + $vals[1][] = $value[1]; + } + + $criteria->add(ListPausedPeer::APP_UID, $vals[0], Criteria::IN); + $criteria->add(ListPausedPeer::DEL_INDEX, $vals[1], Criteria::IN); + } + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + $affectedRows = 0; // initialize var to track total num of affected rows + + try { + // use transaction because $criteria could contain info + // for more than one table or we could emulating ON DELETE CASCADE, etc. + $con->begin(); + + $affectedRows += BasePeer::doDelete($criteria, $con); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollback(); + throw $e; + } + } + + /** + * Validates all modified columns of given ListPaused 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 ListPaused $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(ListPaused $obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(ListPausedPeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(ListPausedPeer::TABLE_NAME); + + if (! is_array($cols)) { + $cols = array($cols); + } + + foreach ($cols as $colName) { + if ($tableMap->containsColumn($colName)) { + $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); + $columns[$colName] = $obj->$get(); + } + } + } else { + + } + + return BasePeer::doValidate(ListPausedPeer::DATABASE_NAME, ListPausedPeer::TABLE_NAME, $columns); + } + + /** + * Retrieve object using using composite pkey values. + * @param string $app_uid + * @param int $del_index + * @param Connection $con + * @return ListPaused + */ + public static function retrieveByPK($app_uid, $del_index, $con = null) + { + if ($con === null) { + $con = Propel::getConnection(self::DATABASE_NAME); + } + $criteria = new Criteria(); + $criteria->add(ListPausedPeer::APP_UID, $app_uid); + $criteria->add(ListPausedPeer::DEL_INDEX, $del_index); + $v = ListPausedPeer::doSelect($criteria, $con); + + return !empty($v) ? $v[0] : null; + } +} + + +// static code to register the map builder for this Peer with the main Propel class +if (Propel::isInit()) { + // the MapBuilder classes register themselves with Propel during initialization + // so we need to load them here. + try { + BaseListPausedPeer::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/ListPausedMapBuilder.php'; + Propel::registerMapBuilder('classes.model.map.ListPausedMapBuilder'); +} +