From 88def091e399261b289481292aee6319e5c8f3b1 Mon Sep 17 00:00:00 2001 From: Gustavo Cruz Date: Fri, 13 Mar 2015 10:12:25 -0400 Subject: [PATCH] Adding the generated model classes for the actions by email --- .../model/map/AbeConfigurationMapBuilder.php | 7 +- .../model/map/AbeRequestsMapBuilder.php | 7 +- .../model/map/AbeResponsesMapBuilder.php | 7 +- .../classes/model/om/BaseAbeConfiguration.php | 176 +++++++++--------- .../model/om/BaseAbeConfigurationPeer.php | 66 +++---- .../classes/model/om/BaseAbeRequests.php | 152 +++++++-------- .../classes/model/om/BaseAbeRequestsPeer.php | 75 ++++---- .../classes/model/om/BaseAbeResponses.php | 122 ++++++------ .../classes/model/om/BaseAbeResponsesPeer.php | 59 +++--- 9 files changed, 328 insertions(+), 343 deletions(-) diff --git a/workflow/engine/classes/model/map/AbeConfigurationMapBuilder.php b/workflow/engine/classes/model/map/AbeConfigurationMapBuilder.php index 6f5bae566..c9fd9c521 100644 --- a/workflow/engine/classes/model/map/AbeConfigurationMapBuilder.php +++ b/workflow/engine/classes/model/map/AbeConfigurationMapBuilder.php @@ -1,4 +1,5 @@ addColumn('ABE_CREATE_DATE', 'AbeCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null); $tMap->addColumn('ABE_UPDATE_DATE', 'AbeUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null); + } // doBuild() -} - -// AbeConfigurationMapBuilder +} // AbeConfigurationMapBuilder diff --git a/workflow/engine/classes/model/map/AbeRequestsMapBuilder.php b/workflow/engine/classes/model/map/AbeRequestsMapBuilder.php index a45c44784..6181e5dad 100644 --- a/workflow/engine/classes/model/map/AbeRequestsMapBuilder.php +++ b/workflow/engine/classes/model/map/AbeRequestsMapBuilder.php @@ -1,4 +1,5 @@ addColumn('ABE_REQ_STATUS', 'AbeReqStatus', 'string', CreoleTypes::VARCHAR, false, 10); $tMap->addColumn('ABE_REQ_ANSWERED', 'AbeReqAnswered', 'int', CreoleTypes::TINYINT, true, null); + } // doBuild() -} - -// AbeRequestsMapBuilder +} // AbeRequestsMapBuilder diff --git a/workflow/engine/classes/model/map/AbeResponsesMapBuilder.php b/workflow/engine/classes/model/map/AbeResponsesMapBuilder.php index 510690467..4d50d63c0 100644 --- a/workflow/engine/classes/model/map/AbeResponsesMapBuilder.php +++ b/workflow/engine/classes/model/map/AbeResponsesMapBuilder.php @@ -1,4 +1,5 @@ addColumn('ABE_RES_STATUS', 'AbeResStatus', 'string', CreoleTypes::VARCHAR, true, 10); $tMap->addColumn('ABE_RES_MESSAGE', 'AbeResMessage', 'string', CreoleTypes::VARCHAR, false, 255); + } // doBuild() -} - -// AbeResponsesMapBuilder +} // AbeResponsesMapBuilder diff --git a/workflow/engine/classes/model/om/BaseAbeConfiguration.php b/workflow/engine/classes/model/om/BaseAbeConfiguration.php index 22132feba..922400986 100644 --- a/workflow/engine/classes/model/om/BaseAbeConfiguration.php +++ b/workflow/engine/classes/model/om/BaseAbeConfiguration.php @@ -1,4 +1,5 @@ abe_uid; } /** * Get the [pro_uid] column value. - * + * * @return string */ public function getProUid() @@ -146,7 +137,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent /** * Get the [tas_uid] column value. - * + * * @return string */ public function getTasUid() @@ -157,7 +148,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent /** * Get the [abe_type] column value. - * + * * @return string */ public function getAbeType() @@ -168,7 +159,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent /** * Get the [abe_template] column value. - * + * * @return string */ public function getAbeTemplate() @@ -179,7 +170,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent /** * Get the [abe_dyn_type] column value. - * + * * @return string */ public function getAbeDynType() @@ -190,7 +181,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent /** * Get the [dyn_uid] column value. - * + * * @return string */ public function getDynUid() @@ -201,7 +192,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent /** * Get the [abe_email_field] column value. - * + * * @return string */ public function getAbeEmailField() @@ -212,7 +203,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent /** * Get the [abe_action_field] column value. - * + * * @return string */ public function getAbeActionField() @@ -223,7 +214,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent /** * Get the [abe_case_note_in_response] column value. - * + * * @return int */ public function getAbeCaseNoteInResponse() @@ -234,9 +225,9 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent /** * Get the [optionally formatted] [abe_create_date] column value. - * + * * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is NULL, then the integer unix timestamp will be returned. + * 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. */ @@ -249,8 +240,8 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent // a non-timestamp value was set externally, so we convert it $ts = strtotime($this->abe_create_date); if ($ts === -1 || $ts === false) { - // in PHP 5.1 return value changes to FALSE - throw new PropelException("Unable to parse value of [abe_create_date] as date/time value: " . var_export($this->abe_create_date, true)); + throw new PropelException("Unable to parse value of [abe_create_date] as date/time value: " . + var_export($this->abe_create_date, true)); } } else { $ts = $this->abe_create_date; @@ -266,9 +257,9 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent /** * Get the [optionally formatted] [abe_update_date] column value. - * + * * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is NULL, then the integer unix timestamp will be returned. + * 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. */ @@ -281,8 +272,8 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent // a non-timestamp value was set externally, so we convert it $ts = strtotime($this->abe_update_date); if ($ts === -1 || $ts === false) { - // in PHP 5.1 return value changes to FALSE - throw new PropelException("Unable to parse value of [abe_update_date] as date/time value: " . var_export($this->abe_update_date, true)); + throw new PropelException("Unable to parse value of [abe_update_date] as date/time value: " . + var_export($this->abe_update_date, true)); } } else { $ts = $this->abe_update_date; @@ -298,7 +289,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent /** * Set the value of [abe_uid] column. - * + * * @param string $v new value * @return void */ @@ -316,12 +307,11 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent $this->modifiedColumns[] = AbeConfigurationPeer::ABE_UID; } - } - // setAbeUid() + } // setAbeUid() /** * Set the value of [pro_uid] column. - * + * * @param string $v new value * @return void */ @@ -339,12 +329,11 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent $this->modifiedColumns[] = AbeConfigurationPeer::PRO_UID; } - } - // setProUid() + } // setProUid() /** * Set the value of [tas_uid] column. - * + * * @param string $v new value * @return void */ @@ -362,12 +351,11 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent $this->modifiedColumns[] = AbeConfigurationPeer::TAS_UID; } - } - // setTasUid() + } // setTasUid() /** * Set the value of [abe_type] column. - * + * * @param string $v new value * @return void */ @@ -385,12 +373,11 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent $this->modifiedColumns[] = AbeConfigurationPeer::ABE_TYPE; } - } - // setAbeType() + } // setAbeType() /** * Set the value of [abe_template] column. - * + * * @param string $v new value * @return void */ @@ -408,12 +395,11 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent $this->modifiedColumns[] = AbeConfigurationPeer::ABE_TEMPLATE; } - } - // setAbeTemplate() + } // setAbeTemplate() /** * Set the value of [abe_dyn_type] column. - * + * * @param string $v new value * @return void */ @@ -431,12 +417,11 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent $this->modifiedColumns[] = AbeConfigurationPeer::ABE_DYN_TYPE; } - } - // setAbeDynType() + } // setAbeDynType() /** * Set the value of [dyn_uid] column. - * + * * @param string $v new value * @return void */ @@ -454,12 +439,11 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent $this->modifiedColumns[] = AbeConfigurationPeer::DYN_UID; } - } - // setDynUid() + } // setDynUid() /** * Set the value of [abe_email_field] column. - * + * * @param string $v new value * @return void */ @@ -477,12 +461,11 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent $this->modifiedColumns[] = AbeConfigurationPeer::ABE_EMAIL_FIELD; } - } - // setAbeEmailField() + } // setAbeEmailField() /** * Set the value of [abe_action_field] column. - * + * * @param string $v new value * @return void */ @@ -500,12 +483,11 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent $this->modifiedColumns[] = AbeConfigurationPeer::ABE_ACTION_FIELD; } - } - // setAbeActionField() + } // setAbeActionField() /** * Set the value of [abe_case_note_in_response] column. - * + * * @param int $v new value * @return void */ @@ -523,12 +505,11 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent $this->modifiedColumns[] = AbeConfigurationPeer::ABE_CASE_NOTE_IN_RESPONSE; } - } - // setAbeCaseNoteInResponse() + } // setAbeCaseNoteInResponse() /** * Set the value of [abe_create_date] column. - * + * * @param int $v new value * @return void */ @@ -537,9 +518,13 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent if ($v !== null && !is_int($v)) { $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } if ($ts === -1 || $ts === false) { - // in PHP 5.1 return value changes to FALSE - throw new PropelException("Unable to parse date/time value for [abe_create_date] from input: " . var_export($v, true)); + throw new PropelException("Unable to parse date/time value for [abe_create_date] from input: " . + var_export($v, true)); } } else { $ts = $v; @@ -549,12 +534,11 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent $this->modifiedColumns[] = AbeConfigurationPeer::ABE_CREATE_DATE; } - } - // setAbeCreateDate() + } // setAbeCreateDate() /** * Set the value of [abe_update_date] column. - * + * * @param int $v new value * @return void */ @@ -563,9 +547,13 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent if ($v !== null && !is_int($v)) { $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } if ($ts === -1 || $ts === false) { - // in PHP 5.1 return value changes to FALSE - throw new PropelException("Unable to parse date/time value for [abe_update_date] from input: " . var_export($v, true)); + throw new PropelException("Unable to parse date/time value for [abe_update_date] from input: " . + var_export($v, true)); } } else { $ts = $v; @@ -575,8 +563,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent $this->modifiedColumns[] = AbeConfigurationPeer::ABE_UPDATE_DATE; } - } - // setAbeUpdateDate() + } // setAbeUpdateDate() /** * Hydrates (populates) the object variables with values from the database resultset. @@ -667,7 +654,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent * wraps the doSave() worker method in a transaction. * * @param Connection $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. + * @return int The number of rows affected by this insert/update * @throws PropelException * @see doSave() */ @@ -699,7 +686,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent * 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 fk objects' save() operations. + * @return int The number of rows affected by this insert/update and any referring * @throws PropelException * @see save() */ @@ -715,8 +702,8 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent if ($this->isNew()) { $pk = AbeConfigurationPeer::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). + // should always be true here (even though technically + // BasePeer::doInsert() can insert multiple rows). $this->setNew(false); } else { @@ -728,8 +715,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent $this->alreadyInSave = false; } return $affectedRows; - } - // doSave() + } // doSave() /** * Array of ValidationFailed objects. @@ -780,7 +766,8 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent * 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 objets otherwise. + * @return mixed true if all validations pass; + array of ValidationFailed objects otherwise. */ protected function doValidate($columns = null) { @@ -867,8 +854,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent default: return null; break; - } - // switch() + } // switch() } /** @@ -964,8 +950,7 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent case 11: $this->setAbeUpdateDate($value); break; - } - // switch() + } // switch() } /** @@ -991,39 +976,51 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent if (array_key_exists($keys[0], $arr)) { $this->setAbeUid($arr[$keys[0]]); } + if (array_key_exists($keys[1], $arr)) { $this->setProUid($arr[$keys[1]]); } + if (array_key_exists($keys[2], $arr)) { $this->setTasUid($arr[$keys[2]]); } + if (array_key_exists($keys[3], $arr)) { $this->setAbeType($arr[$keys[3]]); } + if (array_key_exists($keys[4], $arr)) { $this->setAbeTemplate($arr[$keys[4]]); } + if (array_key_exists($keys[5], $arr)) { $this->setAbeDynType($arr[$keys[5]]); } + if (array_key_exists($keys[6], $arr)) { $this->setDynUid($arr[$keys[6]]); } + if (array_key_exists($keys[7], $arr)) { $this->setAbeEmailField($arr[$keys[7]]); } + if (array_key_exists($keys[8], $arr)) { $this->setAbeActionField($arr[$keys[8]]); } + if (array_key_exists($keys[9], $arr)) { $this->setAbeCaseNoteInResponse($arr[$keys[9]]); } + if (array_key_exists($keys[10], $arr)) { $this->setAbeCreateDate($arr[$keys[10]]); } + if (array_key_exists($keys[11], $arr)) { $this->setAbeUpdateDate($arr[$keys[11]]); } + } /** @@ -1038,40 +1035,52 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent if ($this->isColumnModified(AbeConfigurationPeer::ABE_UID)) { $criteria->add(AbeConfigurationPeer::ABE_UID, $this->abe_uid); } + if ($this->isColumnModified(AbeConfigurationPeer::PRO_UID)) { $criteria->add(AbeConfigurationPeer::PRO_UID, $this->pro_uid); } + if ($this->isColumnModified(AbeConfigurationPeer::TAS_UID)) { $criteria->add(AbeConfigurationPeer::TAS_UID, $this->tas_uid); } + if ($this->isColumnModified(AbeConfigurationPeer::ABE_TYPE)) { $criteria->add(AbeConfigurationPeer::ABE_TYPE, $this->abe_type); } + if ($this->isColumnModified(AbeConfigurationPeer::ABE_TEMPLATE)) { $criteria->add(AbeConfigurationPeer::ABE_TEMPLATE, $this->abe_template); } + if ($this->isColumnModified(AbeConfigurationPeer::ABE_DYN_TYPE)) { $criteria->add(AbeConfigurationPeer::ABE_DYN_TYPE, $this->abe_dyn_type); } + if ($this->isColumnModified(AbeConfigurationPeer::DYN_UID)) { $criteria->add(AbeConfigurationPeer::DYN_UID, $this->dyn_uid); } + if ($this->isColumnModified(AbeConfigurationPeer::ABE_EMAIL_FIELD)) { $criteria->add(AbeConfigurationPeer::ABE_EMAIL_FIELD, $this->abe_email_field); } + if ($this->isColumnModified(AbeConfigurationPeer::ABE_ACTION_FIELD)) { $criteria->add(AbeConfigurationPeer::ABE_ACTION_FIELD, $this->abe_action_field); } + if ($this->isColumnModified(AbeConfigurationPeer::ABE_CASE_NOTE_IN_RESPONSE)) { $criteria->add(AbeConfigurationPeer::ABE_CASE_NOTE_IN_RESPONSE, $this->abe_case_note_in_response); } + if ($this->isColumnModified(AbeConfigurationPeer::ABE_CREATE_DATE)) { $criteria->add(AbeConfigurationPeer::ABE_CREATE_DATE, $this->abe_create_date); } + if ($this->isColumnModified(AbeConfigurationPeer::ABE_UPDATE_DATE)) { $criteria->add(AbeConfigurationPeer::ABE_UPDATE_DATE, $this->abe_update_date); } + return $criteria; } @@ -1192,5 +1201,4 @@ abstract class BaseAbeConfiguration extends BaseObject implements Persistent return self::$peer; } } -// BaseAbeConfiguration diff --git a/workflow/engine/classes/model/om/BaseAbeConfigurationPeer.php b/workflow/engine/classes/model/om/BaseAbeConfigurationPeer.php index 2446faa6a..1a4f44bdd 100644 --- a/workflow/engine/classes/model/om/BaseAbeConfigurationPeer.php +++ b/workflow/engine/classes/model/om/BaseAbeConfigurationPeer.php @@ -1,4 +1,5 @@ getColumns(); $nameMap = array(); - foreach ($columns as $column) { $nameMap[$column->getPhpName()] = $column->getColumnName(); } - self::$phpNameMap = $nameMap; } - return self::$phpNameMap; } - /** * Translates a fieldname to another type * @@ -142,11 +141,9 @@ abstract class BaseAbeConfigurationPeer { $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]; } @@ -164,7 +161,6 @@ abstract class BaseAbeConfigurationPeer 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]; } @@ -173,8 +169,8 @@ abstract class BaseAbeConfigurationPeer * * 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); + * $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. AbeConfigurationPeer::COLUMN_NAME). @@ -194,10 +190,11 @@ abstract class BaseAbeConfigurationPeer * * @param criteria object containing the columns to add. * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. + * rethrown wrapped into a PropelException. */ public static function addSelectColumns(Criteria $criteria) { + $criteria->addSelectColumn(AbeConfigurationPeer::ABE_UID); $criteria->addSelectColumn(AbeConfigurationPeer::PRO_UID); @@ -221,6 +218,7 @@ abstract class BaseAbeConfigurationPeer $criteria->addSelectColumn(AbeConfigurationPeer::ABE_CREATE_DATE); $criteria->addSelectColumn(AbeConfigurationPeer::ABE_UPDATE_DATE); + } const COUNT = 'COUNT(ABE_CONFIGURATION.ABE_UID)'; @@ -241,7 +239,6 @@ abstract class BaseAbeConfigurationPeer // clear out anything that might confuse the ORDER BY clause $criteria->clearSelectColumns()->clearOrderByColumns(); - if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { $criteria->addSelectColumn(AbeConfigurationPeer::COUNT_DISTINCT); } else { @@ -254,7 +251,6 @@ abstract class BaseAbeConfigurationPeer } $rs = AbeConfigurationPeer::doSelectRS($criteria, $con); - if ($rs->next()) { return $rs->getInt(1); } else { @@ -262,7 +258,6 @@ abstract class BaseAbeConfigurationPeer return 0; } } - /** * Method to select one object from the DB. * @@ -270,18 +265,16 @@ abstract class BaseAbeConfigurationPeer * @param Connection $con * @return AbeConfiguration * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. + * rethrown wrapped into a PropelException. */ public static function doSelectOne(Criteria $criteria, $con = null) { $critcopy = clone $criteria; $critcopy->setLimit(1); $objects = AbeConfigurationPeer::doSelect($critcopy, $con); - if ($objects) { return $objects[0]; } - return null; } /** @@ -291,7 +284,7 @@ abstract class BaseAbeConfigurationPeer * @param Connection $con * @return array Array of selected Objects * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. + * rethrown wrapped into a PropelException. */ public static function doSelect(Criteria $criteria, $con = null) { @@ -307,7 +300,7 @@ abstract class BaseAbeConfigurationPeer * @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. + * rethrown wrapped into a PropelException. * @return ResultSet The resultset object with numerically-indexed fields. * @see BasePeer::doSelect() */ @@ -334,7 +327,7 @@ abstract class BaseAbeConfigurationPeer * objects that inherit from the default. * * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. + * rethrown wrapped into a PropelException. */ public static function populateObjects(ResultSet $rs) { @@ -351,7 +344,6 @@ abstract class BaseAbeConfigurationPeer $results[] = $obj; } - return $results; } /** @@ -359,7 +351,7 @@ abstract class BaseAbeConfigurationPeer * 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. + * rethrown wrapped into a PropelException. */ public static function getTableMap() { @@ -387,7 +379,7 @@ abstract class BaseAbeConfigurationPeer * @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. + * rethrown wrapped into a PropelException. */ public static function doInsert($values, $con = null) { @@ -422,11 +414,11 @@ abstract class BaseAbeConfigurationPeer /** * Method perform an UPDATE on the database, given a AbeConfiguration or Criteria object. * - * @param mixed $values Criteria or AbeConfiguration object containing data that is used to create the UPDATE statement. - * @param Connection $con The connection to use (specify Connection object to exert more control over transactions). + * @param mixed $values Criteria or AbeConfiguration 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. + * rethrown wrapped into a PropelException. */ public static function doUpdate($values, $con = null) { @@ -443,7 +435,6 @@ abstract class BaseAbeConfigurationPeer $selectCriteria->add(AbeConfigurationPeer::ABE_UID, $criteria->remove(AbeConfigurationPeer::ABE_UID), $comparison); } else { - // $values is AbeConfiguration object $criteria = $values->buildCriteria(); // gets full criteria $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s) } @@ -464,9 +455,7 @@ abstract class BaseAbeConfigurationPeer 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. @@ -486,11 +475,12 @@ abstract class BaseAbeConfigurationPeer * @param mixed $values Criteria or AbeConfiguration 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. + * @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. - */ + * rethrown wrapped into a PropelException. + */ public static function doDelete($values, $con = null) { if ($con === null) { @@ -500,6 +490,7 @@ abstract class BaseAbeConfigurationPeer if ($values instanceof Criteria) { $criteria = clone $values; // rename for clarity } elseif ($values instanceof AbeConfiguration) { + $criteria = $values->buildPkeyCriteria(); } else { // it must be the primary key @@ -519,7 +510,6 @@ abstract class BaseAbeConfigurationPeer $affectedRows += BasePeer::doDelete($criteria, $con); $con->commit(); - return $affectedRows; } catch (PropelException $e) { $con->rollback(); @@ -558,6 +548,7 @@ abstract class BaseAbeConfigurationPeer } } } else { + } return BasePeer::doValidate(AbeConfigurationPeer::DATABASE_NAME, AbeConfigurationPeer::TABLE_NAME, $columns); @@ -592,7 +583,7 @@ abstract class BaseAbeConfigurationPeer * @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. + * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, $con = null) { @@ -612,7 +603,6 @@ abstract class BaseAbeConfigurationPeer } } -// BaseAbeConfigurationPeer // static code to register the map builder for this Peer with the main Propel class if (Propel::isInit()) { diff --git a/workflow/engine/classes/model/om/BaseAbeRequests.php b/workflow/engine/classes/model/om/BaseAbeRequests.php index d6edd8885..35d671112 100644 --- a/workflow/engine/classes/model/om/BaseAbeRequests.php +++ b/workflow/engine/classes/model/om/BaseAbeRequests.php @@ -1,4 +1,5 @@ abe_req_date); if ($ts === -1 || $ts === false) { - // in PHP 5.1 return value changes to FALSE - throw new PropelException("Unable to parse value of [abe_req_date] as date/time value: " . var_export($this->abe_req_date, true)); + throw new PropelException("Unable to parse value of [abe_req_date] as date/time value: " . + var_export($this->abe_req_date, true)); } } else { $ts = $this->abe_req_date; @@ -220,7 +212,7 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent /** * Get the [abe_req_status] column value. - * + * * @return string */ public function getAbeReqStatus() @@ -231,7 +223,7 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent /** * Get the [abe_req_answered] column value. - * + * * @return int */ public function getAbeReqAnswered() @@ -242,7 +234,7 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent /** * Set the value of [abe_req_uid] column. - * + * * @param string $v new value * @return void */ @@ -260,12 +252,11 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent $this->modifiedColumns[] = AbeRequestsPeer::ABE_REQ_UID; } - } - // setAbeReqUid() + } // setAbeReqUid() /** * Set the value of [abe_uid] column. - * + * * @param string $v new value * @return void */ @@ -283,12 +274,11 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent $this->modifiedColumns[] = AbeRequestsPeer::ABE_UID; } - } - // setAbeUid() + } // setAbeUid() /** * Set the value of [app_uid] column. - * + * * @param string $v new value * @return void */ @@ -306,12 +296,11 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent $this->modifiedColumns[] = AbeRequestsPeer::APP_UID; } - } - // setAppUid() + } // setAppUid() /** * Set the value of [del_index] column. - * + * * @param int $v new value * @return void */ @@ -329,12 +318,11 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent $this->modifiedColumns[] = AbeRequestsPeer::DEL_INDEX; } - } - // setDelIndex() + } // setDelIndex() /** * Set the value of [abe_req_sent_to] column. - * + * * @param string $v new value * @return void */ @@ -352,12 +340,11 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent $this->modifiedColumns[] = AbeRequestsPeer::ABE_REQ_SENT_TO; } - } - // setAbeReqSentTo() + } // setAbeReqSentTo() /** * Set the value of [abe_req_subject] column. - * + * * @param string $v new value * @return void */ @@ -375,12 +362,11 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent $this->modifiedColumns[] = AbeRequestsPeer::ABE_REQ_SUBJECT; } - } - // setAbeReqSubject() + } // setAbeReqSubject() /** * Set the value of [abe_req_body] column. - * + * * @param string $v new value * @return void */ @@ -393,17 +379,16 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent $v = (string) $v; } - if ($this->abe_req_body !== $v || $v === '') { + if ($this->abe_req_body !== $v) { $this->abe_req_body = $v; $this->modifiedColumns[] = AbeRequestsPeer::ABE_REQ_BODY; } - } - // setAbeReqBody() + } // setAbeReqBody() /** * Set the value of [abe_req_date] column. - * + * * @param int $v new value * @return void */ @@ -412,9 +397,13 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent if ($v !== null && !is_int($v)) { $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } if ($ts === -1 || $ts === false) { - // in PHP 5.1 return value changes to FALSE - throw new PropelException("Unable to parse date/time value for [abe_req_date] from input: " . var_export($v, true)); + throw new PropelException("Unable to parse date/time value for [abe_req_date] from input: " . + var_export($v, true)); } } else { $ts = $v; @@ -424,12 +413,11 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent $this->modifiedColumns[] = AbeRequestsPeer::ABE_REQ_DATE; } - } - // setAbeReqDate() + } // setAbeReqDate() /** * Set the value of [abe_req_status] column. - * + * * @param string $v new value * @return void */ @@ -447,12 +435,11 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent $this->modifiedColumns[] = AbeRequestsPeer::ABE_REQ_STATUS; } - } - // setAbeReqStatus() + } // setAbeReqStatus() /** * Set the value of [abe_req_answered] column. - * + * * @param int $v new value * @return void */ @@ -470,8 +457,7 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent $this->modifiedColumns[] = AbeRequestsPeer::ABE_REQ_ANSWERED; } - } - // setAbeReqAnswered() + } // setAbeReqAnswered() /** * Hydrates (populates) the object variables with values from the database resultset. @@ -558,7 +544,7 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent * wraps the doSave() worker method in a transaction. * * @param Connection $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. + * @return int The number of rows affected by this insert/update * @throws PropelException * @see doSave() */ @@ -590,14 +576,13 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent * 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 fk objects' save() operations. + * @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 + $affectedRows = 0; // initialize var to track total num of affected rows if (!$this->alreadyInSave) { $this->alreadyInSave = true; @@ -607,22 +592,20 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent if ($this->isNew()) { $pk = AbeRequestsPeer::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). + // should always be true here (even though technically + // BasePeer::doInsert() can insert multiple rows). $this->setNew(false); } else { $affectedRows += AbeRequestsPeer::doUpdate($this, $con); } - $this->resetModified(); - // [HL] After being saved an object is no longer 'modified' + $this->resetModified(); // [HL] After being saved an object is no longer 'modified' } $this->alreadyInSave = false; } return $affectedRows; - } - // doSave() + } // doSave() /** * Array of ValidationFailed objects. @@ -673,7 +656,8 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent * 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 objets otherwise. + * @return mixed true if all validations pass; + array of ValidationFailed objects otherwise. */ protected function doValidate($columns = null) { @@ -754,8 +738,7 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent default: return null; break; - } - // switch() + } // switch() } /** @@ -843,8 +826,7 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent case 9: $this->setAbeReqAnswered($value); break; - } - // switch() + } // switch() } /** @@ -870,33 +852,43 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent if (array_key_exists($keys[0], $arr)) { $this->setAbeReqUid($arr[$keys[0]]); } + if (array_key_exists($keys[1], $arr)) { $this->setAbeUid($arr[$keys[1]]); } + if (array_key_exists($keys[2], $arr)) { $this->setAppUid($arr[$keys[2]]); } + if (array_key_exists($keys[3], $arr)) { $this->setDelIndex($arr[$keys[3]]); } + if (array_key_exists($keys[4], $arr)) { $this->setAbeReqSentTo($arr[$keys[4]]); } + if (array_key_exists($keys[5], $arr)) { $this->setAbeReqSubject($arr[$keys[5]]); } + if (array_key_exists($keys[6], $arr)) { $this->setAbeReqBody($arr[$keys[6]]); } + if (array_key_exists($keys[7], $arr)) { $this->setAbeReqDate($arr[$keys[7]]); } + if (array_key_exists($keys[8], $arr)) { $this->setAbeReqStatus($arr[$keys[8]]); } + if (array_key_exists($keys[9], $arr)) { $this->setAbeReqAnswered($arr[$keys[9]]); } + } /** @@ -911,34 +903,44 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent if ($this->isColumnModified(AbeRequestsPeer::ABE_REQ_UID)) { $criteria->add(AbeRequestsPeer::ABE_REQ_UID, $this->abe_req_uid); } + if ($this->isColumnModified(AbeRequestsPeer::ABE_UID)) { $criteria->add(AbeRequestsPeer::ABE_UID, $this->abe_uid); } + if ($this->isColumnModified(AbeRequestsPeer::APP_UID)) { $criteria->add(AbeRequestsPeer::APP_UID, $this->app_uid); } + if ($this->isColumnModified(AbeRequestsPeer::DEL_INDEX)) { $criteria->add(AbeRequestsPeer::DEL_INDEX, $this->del_index); } + if ($this->isColumnModified(AbeRequestsPeer::ABE_REQ_SENT_TO)) { $criteria->add(AbeRequestsPeer::ABE_REQ_SENT_TO, $this->abe_req_sent_to); } + if ($this->isColumnModified(AbeRequestsPeer::ABE_REQ_SUBJECT)) { $criteria->add(AbeRequestsPeer::ABE_REQ_SUBJECT, $this->abe_req_subject); } + if ($this->isColumnModified(AbeRequestsPeer::ABE_REQ_BODY)) { $criteria->add(AbeRequestsPeer::ABE_REQ_BODY, $this->abe_req_body); } + if ($this->isColumnModified(AbeRequestsPeer::ABE_REQ_DATE)) { $criteria->add(AbeRequestsPeer::ABE_REQ_DATE, $this->abe_req_date); } + if ($this->isColumnModified(AbeRequestsPeer::ABE_REQ_STATUS)) { $criteria->add(AbeRequestsPeer::ABE_REQ_STATUS, $this->abe_req_status); } + if ($this->isColumnModified(AbeRequestsPeer::ABE_REQ_ANSWERED)) { $criteria->add(AbeRequestsPeer::ABE_REQ_ANSWERED, $this->abe_req_answered); } + return $criteria; } @@ -1056,5 +1058,3 @@ abstract class BaseAbeRequests extends BaseObject implements Persistent } } -// BaseAbeRequests - diff --git a/workflow/engine/classes/model/om/BaseAbeRequestsPeer.php b/workflow/engine/classes/model/om/BaseAbeRequestsPeer.php index 00bfe2f86..1bfa7771e 100644 --- a/workflow/engine/classes/model/om/BaseAbeRequestsPeer.php +++ b/workflow/engine/classes/model/om/BaseAbeRequestsPeer.php @@ -1,4 +1,5 @@ array ('AbeReqUid', 'AbeUid', 'AppUid', 'DelIndex', 'AbeReqSentTo', 'AbeReqSubject', 'AbeReqBody', 'AbeReqDate', 'AbeReqStatus', 'AbeReqAnswered', ), BasePeer::TYPE_COLNAME => array (AbeRequestsPeer::ABE_REQ_UID, AbeRequestsPeer::ABE_UID, AbeRequestsPeer::APP_UID, AbeRequestsPeer::DEL_INDEX, AbeRequestsPeer::ABE_REQ_SENT_TO, AbeRequestsPeer::ABE_REQ_SUBJECT, AbeRequestsPeer::ABE_REQ_BODY, AbeRequestsPeer::ABE_REQ_DATE, AbeRequestsPeer::ABE_REQ_STATUS, AbeRequestsPeer::ABE_REQ_ANSWERED, ), @@ -77,11 +79,11 @@ abstract class BaseAbeRequestsPeer ); /** - * 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 - */ + * 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 ('AbeReqUid' => 0, 'AbeUid' => 1, 'AppUid' => 2, 'DelIndex' => 3, 'AbeReqSentTo' => 4, 'AbeReqSubject' => 5, 'AbeReqBody' => 6, 'AbeReqDate' => 7, 'AbeReqStatus' => 8, 'AbeReqAnswered' => 9, ), BasePeer::TYPE_COLNAME => array (AbeRequestsPeer::ABE_REQ_UID => 0, AbeRequestsPeer::ABE_UID => 1, AbeRequestsPeer::APP_UID => 2, AbeRequestsPeer::DEL_INDEX => 3, AbeRequestsPeer::ABE_REQ_SENT_TO => 4, AbeRequestsPeer::ABE_REQ_SUBJECT => 5, AbeRequestsPeer::ABE_REQ_BODY => 6, AbeRequestsPeer::ABE_REQ_DATE => 7, AbeRequestsPeer::ABE_REQ_STATUS => 8, AbeRequestsPeer::ABE_REQ_ANSWERED => 9, ), @@ -90,10 +92,10 @@ abstract class BaseAbeRequestsPeer ); /** - * @return MapBuilder the map builder for this peer - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ + * @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/AbeRequestsMapBuilder.php'; @@ -104,7 +106,7 @@ abstract class BaseAbeRequestsPeer * * @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. + * rethrown wrapped into a PropelException. * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this. */ public static function getPhpNameMap() @@ -113,14 +115,11 @@ abstract class BaseAbeRequestsPeer $map = AbeRequestsPeer::getTableMap(); $columns = $map->getColumns(); $nameMap = array(); - foreach ($columns as $column) { $nameMap[$column->getPhpName()] = $column->getColumnName(); } - self::$phpNameMap = $nameMap; } - return self::$phpNameMap; } /** @@ -136,7 +135,6 @@ abstract class BaseAbeRequestsPeer { $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)); } @@ -165,8 +163,8 @@ abstract class BaseAbeRequestsPeer * * 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); + * $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. AbeRequestsPeer::COLUMN_NAME). @@ -186,7 +184,7 @@ abstract class BaseAbeRequestsPeer * * @param criteria object containing the columns to add. * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. + * rethrown wrapped into a PropelException. */ public static function addSelectColumns(Criteria $criteria) { @@ -257,7 +255,7 @@ abstract class BaseAbeRequestsPeer * @param Connection $con * @return AbeRequests * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. + * rethrown wrapped into a PropelException. */ public static function doSelectOne(Criteria $criteria, $con = null) { @@ -276,7 +274,7 @@ abstract class BaseAbeRequestsPeer * @param Connection $con * @return array Array of selected Objects * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. + * rethrown wrapped into a PropelException. */ public static function doSelect(Criteria $criteria, $con = null) { @@ -292,7 +290,7 @@ abstract class BaseAbeRequestsPeer * @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. + * rethrown wrapped into a PropelException. * @return ResultSet The resultset object with numerically-indexed fields. * @see BasePeer::doSelect() */ @@ -319,7 +317,7 @@ abstract class BaseAbeRequestsPeer * objects that inherit from the default. * * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. + * rethrown wrapped into a PropelException. */ public static function populateObjects(ResultSet $rs) { @@ -343,7 +341,7 @@ abstract class BaseAbeRequestsPeer * 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. + * rethrown wrapped into a PropelException. */ public static function getTableMap() { @@ -371,7 +369,7 @@ abstract class BaseAbeRequestsPeer * @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. + * rethrown wrapped into a PropelException. */ public static function doInsert($values, $con = null) { @@ -406,11 +404,11 @@ abstract class BaseAbeRequestsPeer /** * Method perform an UPDATE on the database, given a AbeRequests or Criteria object. * - * @param mixed $values Criteria or AbeRequests object containing data that is used to create the UPDATE statement. - * @param Connection $con The connection to use (specify Connection object to exert more control over transactions). + * @param mixed $values Criteria or AbeRequests 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. + * rethrown wrapped into a PropelException. */ public static function doUpdate($values, $con = null) { @@ -427,7 +425,6 @@ abstract class BaseAbeRequestsPeer $selectCriteria->add(AbeRequestsPeer::ABE_REQ_UID, $criteria->remove(AbeRequestsPeer::ABE_REQ_UID), $comparison); } else { - // $values is AbeRequests object $criteria = $values->buildCriteria(); // gets full criteria $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s) } @@ -468,11 +465,12 @@ abstract class BaseAbeRequestsPeer * @param mixed $values Criteria or AbeRequests 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. + * @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. - */ + * rethrown wrapped into a PropelException. + */ public static function doDelete($values, $con = null) { if ($con === null) { @@ -575,7 +573,7 @@ abstract class BaseAbeRequestsPeer * @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. + * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, $con = null) { @@ -595,7 +593,6 @@ abstract class BaseAbeRequestsPeer } } -// BaseAbeRequestsPeer // static code to register the map builder for this Peer with the main Propel class if (Propel::isInit()) { diff --git a/workflow/engine/classes/model/om/BaseAbeResponses.php b/workflow/engine/classes/model/om/BaseAbeResponses.php index d162e28f4..863bb3fcc 100644 --- a/workflow/engine/classes/model/om/BaseAbeResponses.php +++ b/workflow/engine/classes/model/om/BaseAbeResponses.php @@ -1,4 +1,5 @@ abe_res_date); if ($ts === -1 || $ts === false) { - // in PHP 5.1 return value changes to FALSE - throw new PropelException("Unable to parse value of [abe_res_date] as date/time value: " . var_export($this->abe_res_date, true)); + throw new PropelException("Unable to parse value of [abe_res_date] as date/time value: " . + var_export($this->abe_res_date, true)); } } else { $ts = $this->abe_res_date; @@ -166,7 +161,7 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent /** * Get the [abe_res_status] column value. - * + * * @return string */ public function getAbeResStatus() @@ -177,7 +172,7 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent /** * Get the [abe_res_message] column value. - * + * * @return string */ public function getAbeResMessage() @@ -188,7 +183,7 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent /** * Set the value of [abe_res_uid] column. - * + * * @param string $v new value * @return void */ @@ -206,12 +201,11 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent $this->modifiedColumns[] = AbeResponsesPeer::ABE_RES_UID; } - } - // setAbeResUid() + } // setAbeResUid() /** * Set the value of [abe_req_uid] column. - * + * * @param string $v new value * @return void */ @@ -229,12 +223,11 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent $this->modifiedColumns[] = AbeResponsesPeer::ABE_REQ_UID; } - } - // setAbeReqUid() + } // setAbeReqUid() /** * Set the value of [abe_res_client_ip] column. - * + * * @param string $v new value * @return void */ @@ -252,12 +245,11 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent $this->modifiedColumns[] = AbeResponsesPeer::ABE_RES_CLIENT_IP; } - } - // setAbeResClientIp() + } // setAbeResClientIp() /** * Set the value of [abe_res_data] column. - * + * * @param string $v new value * @return void */ @@ -270,17 +262,16 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent $v = (string) $v; } - if ($this->abe_res_data !== $v || $v === '0') { + if ($this->abe_res_data !== $v) { $this->abe_res_data = $v; $this->modifiedColumns[] = AbeResponsesPeer::ABE_RES_DATA; } - } - // setAbeResData() + } // setAbeResData() /** * Set the value of [abe_res_date] column. - * + * * @param int $v new value * @return void */ @@ -289,9 +280,13 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent if ($v !== null && !is_int($v)) { $ts = strtotime($v); + //Date/time accepts null values + if ($v == '') { + $ts = null; + } if ($ts === -1 || $ts === false) { - // in PHP 5.1 return value changes to FALSE - throw new PropelException("Unable to parse date/time value for [abe_res_date] from input: " . var_export($v, true)); + throw new PropelException("Unable to parse date/time value for [abe_res_date] from input: " . + var_export($v, true)); } } else { $ts = $v; @@ -301,12 +296,11 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent $this->modifiedColumns[] = AbeResponsesPeer::ABE_RES_DATE; } - } - // setAbeResDate() + } // setAbeResDate() /** * Set the value of [abe_res_status] column. - * + * * @param string $v new value * @return void */ @@ -324,12 +318,11 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent $this->modifiedColumns[] = AbeResponsesPeer::ABE_RES_STATUS; } - } - // setAbeResStatus() + } // setAbeResStatus() /** * Set the value of [abe_res_message] column. - * + * * @param string $v new value * @return void */ @@ -347,8 +340,7 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent $this->modifiedColumns[] = AbeResponsesPeer::ABE_RES_MESSAGE; } - } - // setAbeResMessage() + } // setAbeResMessage() /** * Hydrates (populates) the object variables with values from the database resultset. @@ -429,7 +421,7 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent * wraps the doSave() worker method in a transaction. * * @param Connection $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. + * @return int The number of rows affected by this insert/update * @throws PropelException * @see doSave() */ @@ -461,14 +453,13 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent * 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 fk objects' save() operations. + * @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 + $affectedRows = 0; // initialize var to track total num of affected rows if (!$this->alreadyInSave) { $this->alreadyInSave = true; @@ -477,10 +468,9 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent if ($this->isModified()) { if ($this->isNew()) { $pk = AbeResponsesPeer::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). + $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 { @@ -492,8 +482,7 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent $this->alreadyInSave = false; } return $affectedRows; - } - // doSave() + } // doSave() /** * Array of ValidationFailed objects. @@ -544,7 +533,8 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent * 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 objets otherwise. + * @return mixed true if all validations pass; + array of ValidationFailed objects otherwise. */ protected function doValidate($columns = null) { @@ -616,8 +606,7 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent default: return null; break; - } - // switch() + } // switch() } /** @@ -693,8 +682,7 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent case 6: $this->setAbeResMessage($value); break; - } - // switch() + } // switch() } /** @@ -720,24 +708,31 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent if (array_key_exists($keys[0], $arr)) { $this->setAbeResUid($arr[$keys[0]]); } + if (array_key_exists($keys[1], $arr)) { $this->setAbeReqUid($arr[$keys[1]]); } + if (array_key_exists($keys[2], $arr)) { $this->setAbeResClientIp($arr[$keys[2]]); } + if (array_key_exists($keys[3], $arr)) { $this->setAbeResData($arr[$keys[3]]); } + if (array_key_exists($keys[4], $arr)) { $this->setAbeResDate($arr[$keys[4]]); } + if (array_key_exists($keys[5], $arr)) { $this->setAbeResStatus($arr[$keys[5]]); } + if (array_key_exists($keys[6], $arr)) { $this->setAbeResMessage($arr[$keys[6]]); } + } /** @@ -752,25 +747,32 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent if ($this->isColumnModified(AbeResponsesPeer::ABE_RES_UID)) { $criteria->add(AbeResponsesPeer::ABE_RES_UID, $this->abe_res_uid); } + if ($this->isColumnModified(AbeResponsesPeer::ABE_REQ_UID)) { $criteria->add(AbeResponsesPeer::ABE_REQ_UID, $this->abe_req_uid); } + if ($this->isColumnModified(AbeResponsesPeer::ABE_RES_CLIENT_IP)) { $criteria->add(AbeResponsesPeer::ABE_RES_CLIENT_IP, $this->abe_res_client_ip); } + if ($this->isColumnModified(AbeResponsesPeer::ABE_RES_DATA)) { $criteria->add(AbeResponsesPeer::ABE_RES_DATA, $this->abe_res_data); } + if ($this->isColumnModified(AbeResponsesPeer::ABE_RES_DATE)) { $criteria->add(AbeResponsesPeer::ABE_RES_DATE, $this->abe_res_date); } + if ($this->isColumnModified(AbeResponsesPeer::ABE_RES_STATUS)) { $criteria->add(AbeResponsesPeer::ABE_RES_STATUS, $this->abe_res_status); } + if ($this->isColumnModified(AbeResponsesPeer::ABE_RES_MESSAGE)) { $criteria->add(AbeResponsesPeer::ABE_RES_MESSAGE, $this->abe_res_message); } + return $criteria; } @@ -882,5 +884,3 @@ abstract class BaseAbeResponses extends BaseObject implements Persistent } } -// BaseAbeResponses - diff --git a/workflow/engine/classes/model/om/BaseAbeResponsesPeer.php b/workflow/engine/classes/model/om/BaseAbeResponsesPeer.php index 3b68c939f..88da6c38e 100644 --- a/workflow/engine/classes/model/om/BaseAbeResponsesPeer.php +++ b/workflow/engine/classes/model/om/BaseAbeResponsesPeer.php @@ -1,4 +1,5 @@ getColumns(); $nameMap = array(); - foreach ($columns as $column) { $nameMap[$column->getPhpName()] = $column->getColumnName(); } - self::$phpNameMap = $nameMap; } - return self::$phpNameMap; } /** @@ -127,11 +126,9 @@ abstract class BaseAbeResponsesPeer { $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]; } @@ -149,7 +146,6 @@ abstract class BaseAbeResponsesPeer 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]; } @@ -158,8 +154,8 @@ abstract class BaseAbeResponsesPeer * * 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); + * $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. AbeResponsesPeer::COLUMN_NAME). @@ -179,7 +175,7 @@ abstract class BaseAbeResponsesPeer * * @param criteria object containing the columns to add. * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. + * rethrown wrapped into a PropelException. */ public static function addSelectColumns(Criteria $criteria) { @@ -218,7 +214,6 @@ abstract class BaseAbeResponsesPeer // clear out anything that might confuse the ORDER BY clause $criteria->clearSelectColumns()->clearOrderByColumns(); - if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { $criteria->addSelectColumn(AbeResponsesPeer::COUNT_DISTINCT); } else { @@ -245,18 +240,16 @@ abstract class BaseAbeResponsesPeer * @param Connection $con * @return AbeResponses * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. + * rethrown wrapped into a PropelException. */ public static function doSelectOne(Criteria $criteria, $con = null) { $critcopy = clone $criteria; $critcopy->setLimit(1); $objects = AbeResponsesPeer::doSelect($critcopy, $con); - if ($objects) { return $objects[0]; } - return null; } /** @@ -266,7 +259,7 @@ abstract class BaseAbeResponsesPeer * @param Connection $con * @return array Array of selected Objects * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. + * rethrown wrapped into a PropelException. */ public static function doSelect(Criteria $criteria, $con = null) { @@ -282,7 +275,7 @@ abstract class BaseAbeResponsesPeer * @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. + * rethrown wrapped into a PropelException. * @return ResultSet The resultset object with numerically-indexed fields. * @see BasePeer::doSelect() */ @@ -309,7 +302,7 @@ abstract class BaseAbeResponsesPeer * objects that inherit from the default. * * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. + * rethrown wrapped into a PropelException. */ public static function populateObjects(ResultSet $rs) { @@ -326,7 +319,6 @@ abstract class BaseAbeResponsesPeer $results[] = $obj; } - return $results; } /** @@ -334,7 +326,7 @@ abstract class BaseAbeResponsesPeer * 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. + * rethrown wrapped into a PropelException. */ public static function getTableMap() { @@ -362,7 +354,7 @@ abstract class BaseAbeResponsesPeer * @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. + * rethrown wrapped into a PropelException. */ public static function doInsert($values, $con = null) { @@ -397,11 +389,11 @@ abstract class BaseAbeResponsesPeer /** * Method perform an UPDATE on the database, given a AbeResponses or Criteria object. * - * @param mixed $values Criteria or AbeResponses object containing data that is used to create the UPDATE statement. - * @param Connection $con The connection to use (specify Connection object to exert more control over transactions). + * @param mixed $values Criteria or AbeResponses 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. + * rethrown wrapped into a PropelException. */ public static function doUpdate($values, $con = null) { @@ -418,7 +410,6 @@ abstract class BaseAbeResponsesPeer $selectCriteria->add(AbeResponsesPeer::ABE_RES_UID, $criteria->remove(AbeResponsesPeer::ABE_RES_UID), $comparison); } else { - // $values is AbeResponses object $criteria = $values->buildCriteria(); // gets full criteria $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s) } @@ -439,9 +430,7 @@ abstract class BaseAbeResponsesPeer 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. @@ -461,11 +450,12 @@ abstract class BaseAbeResponsesPeer * @param mixed $values Criteria or AbeResponses 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. + * @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. - */ + * rethrown wrapped into a PropelException. + */ public static function doDelete($values, $con = null) { if ($con === null) { @@ -568,7 +558,7 @@ abstract class BaseAbeResponsesPeer * @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. + * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, $con = null) { @@ -577,7 +567,6 @@ abstract class BaseAbeResponsesPeer } $objs = null; - if (empty($pks)) { $objs = array(); } else { @@ -585,12 +574,10 @@ abstract class BaseAbeResponsesPeer $criteria->add(AbeResponsesPeer::ABE_RES_UID, $pks, Criteria::IN); $objs = AbeResponsesPeer::doSelect($criteria, $con); } - return $objs; } } -// BaseAbeResponsesPeer // static code to register the map builder for this Peer with the main Propel class if (Propel::isInit()) {