This commit is contained in:
Paula Quispe
2018-04-20 08:57:55 -04:00
parent 8487e072d9
commit f40431e703
14 changed files with 603 additions and 456 deletions

View File

@@ -1,12 +1,4 @@
<?php
/**
* AppDelay.php
* @package workflow.engine.classes.model
*/
//require_once 'classes/model/om/BaseAppDelay.php';
/**
* Skeleton subclass for representing a row from the 'APP_DELAY' table.
*
@@ -20,93 +12,111 @@
*/
class AppDelay extends BaseAppDelay
{
const APP_TYPE_CANCEL = 'CANCEL';
const APP_TYPE_PAUSE = 'PAUSE';
/**
* Create the application delay registry
* @param array $aData
*
* @param array $data
*
* @return string
* @throws Exception
**/
public function create($aData)
public function create($data)
{
$oConnection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
$connection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
try {
if ( isset ( $aData['APP_DELAY_UID'] ) && $aData['APP_DELAY_UID']== '' ) {
unset ( $aData['APP_DELAY_UID'] );
if (isset ($data['APP_DELAY_UID']) && $data['APP_DELAY_UID'] == '') {
unset ($data['APP_DELAY_UID']);
}
if ( !isset ( $aData['APP_DELAY_UID'] ) ) {
$aData['APP_DELAY_UID'] = G::generateUniqueID();
if (!isset ($data['APP_DELAY_UID'])) {
$data['APP_DELAY_UID'] = G::generateUniqueID();
}
$oAppDelay = new AppDelay();
$oAppDelay->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oAppDelay->validate()) {
$oConnection->begin();
$iResult = $oAppDelay->save();
$oConnection->commit();
return $aData['APP_DELAY_UID'];
$appDelay = new AppDelay();
$appDelay->fromArray($data, BasePeer::TYPE_FIELDNAME);
if ($appDelay->validate()) {
$connection->begin();
$result = $appDelay->save();
$connection->commit();
return $data['APP_DELAY_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oAppDelay->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
$message = '';
$validationFailures = $appDelay->getValidationFailures();
foreach ($validationFailures as $validationFailure) {
$message .= $validationFailure->getMessage() . '<br />';
}
throw(new Exception('The registry cannot be created!<br />'.$sMessage));
throw(new Exception('The registry cannot be created!<br />' . $message));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw($oError);
} catch (Exception $error) {
$connection->rollback();
throw($error);
}
}
/**
* Update the application delay registry
* @param array $aData
*
* @param array $data
*
* @return string
* @throws Exception
**/
public function update($aData)
public function update($data)
{
$oConnection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
$connection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
try {
$oAppDelay = AppDelayPeer::retrieveByPK($aData['APP_DELAY_UID']);
if (!is_null($oAppDelay)) {
$oAppDelay->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oAppDelay->validate()) {
$oConnection->begin();
$iResult = $oAppDelay->save();
$oConnection->commit();
return $iResult;
$appDelay = AppDelayPeer::retrieveByPK($data['APP_DELAY_UID']);
if (!is_null($appDelay)) {
$appDelay->fromArray($data, BasePeer::TYPE_FIELDNAME);
if ($appDelay->validate()) {
$connection->begin();
$result = $appDelay->save();
$connection->commit();
return $result;
} else {
$sMessage = '';
$aValidationFailures = $oAppDelay->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
$message = '';
$validationFailures = $appDelay->getValidationFailures();
foreach ($validationFailures as $validationFailure) {
$message .= $validationFailure->getMessage() . '<br />';
}
throw(new Exception('The registry cannot be updated!<br />'.$sMessage));
throw(new Exception('The registry cannot be updated!<br />'.$message));
}
} else {
throw(new Exception('This row doesn\'t exist!'));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw($oError);
} catch (Exception $error) {
$connection->rollback();
throw($error);
}
}
/**
* Review if the application in a specific index is paused
*
* @param string $appUid
* @param integer $delIndex
*
* @return boolean
*/
public function isPaused($appUid, $delIndex)
{
$oCriteria = new Criteria('workflow');
$oCriteria->add(AppDelayPeer::APP_UID, $appUid);
$oCriteria->add(AppDelayPeer::APP_DEL_INDEX, $delIndex);
$oCriteria->add(AppDelayPeer::APP_TYPE, 'PAUSE');
$oCriteria->add(
$oCriteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, 0, Criteria::EQUAL)->addOr(
$oCriteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, null, Criteria::ISNULL))
$criteria = new Criteria('workflow');
$criteria->add(AppDelayPeer::APP_UID, $appUid);
$criteria->add(AppDelayPeer::APP_DEL_INDEX, $delIndex);
$criteria->add(AppDelayPeer::APP_TYPE, AppDelay::APP_TYPE_PAUSE);
$criteria->add(
$criteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, 0, Criteria::EQUAL)->addOr(
$criteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, null, Criteria::ISNULL))
);
$oDataset = AppDelayPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
$dataset = AppDelayPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$row = $dataset->getRow();
if ($aRow) {
if ($row) {
return true;
} else {
return false;
@@ -117,20 +127,74 @@ class AppDelay extends BaseAppDelay
* Verify if the case is Paused or cancelled
*
* @param $appUid string
* @return $oDataset array
*
* @return array|null
*/
public function getCasesCancelOrPaused($appUid)
{
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( AppDelayPeer::APP_UID );
$oCriteria->addSelectColumn( AppDelayPeer::APP_DEL_INDEX );
$oCriteria->add( AppDelayPeer::APP_UID, $appUid );
$oCriteria->add( $oCriteria->getNewCriterion( AppDelayPeer::APP_TYPE, 'PAUSE' )->addOr( $oCriteria->getNewCriterion( AppDelayPeer::APP_TYPE, 'CANCEL' ) ) );
$oCriteria->addAscendingOrderByColumn( AppDelayPeer::APP_ENABLE_ACTION_DATE );
$oDataset = AppDelayPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
return $oDataset->getRow();
$criteria = new Criteria('workflow');
$criteria->addSelectColumn(AppDelayPeer::APP_UID);
$criteria->addSelectColumn(AppDelayPeer::APP_DEL_INDEX);
$criteria->add(AppDelayPeer::APP_UID, $appUid);
$criteria->add(
$criteria->getNewCriterion(AppDelayPeer::APP_TYPE, AppDelay::APP_TYPE_PAUSE)->addOr(
$criteria->getNewCriterion(AppDelayPeer::APP_TYPE, AppDelay::APP_TYPE_CANCEL)
)
);
$criteria->addAscendingOrderByColumn(AppDelayPeer::APP_ENABLE_ACTION_DATE);
$dataset = AppDelayPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
return $dataset->getRow();
}
/**
* Build the row for the appDelay to be inserted
*
* @param string $proUid
* @param integer $proId
* @param string $appUid
* @param integer $appNumber
* @param integer $appThreadIndex
* @param integer $delIndex
* @param string $appType
* @param string $appStatus
* @param string $usrUid
*
* @return array
*/
public static function buildAppDelayRow(
$proUid = '',
$proId = 0,
$appUid = '',
$appNumber = 0,
$appThreadIndex = 0,
$delIndex = 0,
$appType = 'CANCEL',
$appStatus = 'CANCELLED',
$usrUid = ''
) {
$row = [];
$row['PRO_UID'] = $proUid;
$row['PRO_ID'] = $proId;
$row['APP_UID'] = $appUid;
$row['APP_NUMBER'] = $appNumber;
$row['APP_THREAD_INDEX'] = $appThreadIndex;
$row['APP_DEL_INDEX'] = $delIndex;
$row['APP_TYPE'] = $appType;
$row['APP_STATUS'] = $appStatus;
$row['APP_ENABLE_ACTION_DATE'] = date('Y-m-d H:i:s');
//Define the user that execute the insert
if (empty($usrUid)) {
global $RBAC;
$usrUid = $RBAC->aUserInfo['USER_INFO']['USR_UID'];
}
$row['APP_DELEGATION_USER'] = $usrUid;
$row['APP_ENABLE_ACTION_USER'] = $usrUid;
return $row;
}
}

View File

@@ -331,16 +331,17 @@ class AppDelegation extends BaseAppDelegation
}
}
/* Load the Application Delegation row specified in [app_id] column value.
/**
* Load the Application Delegation row specified in [app_id] column value.
*
* @param string $appUid the uid of the application
* @param integer $index the index of the delegation
*
* @param string $AppUid the uid of the application
* @param string $index the index of the delegation
* @return array $Fields the fields
*/
public function LoadParallel($AppUid, $index = "")
public function LoadParallel($appUid, $index = 0)
{
$aCases = array();
$cases = [];
$c = new Criteria('workflow');
$c->addSelectColumn(AppDelegationPeer::APP_UID);
@@ -348,41 +349,33 @@ class AppDelegation extends BaseAppDelegation
$c->addSelectColumn(AppDelegationPeer::PRO_UID);
$c->addSelectColumn(AppDelegationPeer::TAS_UID);
$c->addSelectColumn(AppDelegationPeer::USR_UID);
$c->addSelectColumn(AppDelegationPeer::DEL_THREAD);
$c->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
$c->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
$c->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
$c->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
$c->addSelectColumn(AppDelegationPeer::DEL_PREVIOUS);
$c->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN');
$c->add(AppDelegationPeer::APP_UID, $AppUid);
if (!empty($index)) {
$c->add(AppDelegationPeer::APP_UID, $appUid);
if ($index > 0) {
$c->add(AppDelegationPeer::DEL_INDEX, $index);
}
$c->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX);
$rs = AppDelegationPeer::doSelectRS($c);
$row= $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$row = $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
while (is_array($row)) {
$case = array();
$case['TAS_UID'] = $row['TAS_UID'];
$case['USR_UID'] = $row['USR_UID'];
$case['DEL_INDEX'] = $row['DEL_INDEX'];
$case['TAS_UID'] = $row['TAS_UID'];
$case['DEL_DELEGATE_DATE'] = $row['DEL_DELEGATE_DATE'];
$case['DEL_INIT_DATE'] = $row['DEL_INIT_DATE'];
$case['DEL_TASK_DUE_DATE'] = $row['DEL_TASK_DUE_DATE'];
$case['DEL_FINISH_DATE'] = $row['DEL_FINISH_DATE'];
$case['DEL_PREVIOUS'] = $row['DEL_PREVIOUS'];
$aCases[] = $case;
$cases[] = $row;
$rs->next();
$row = $rs->getRow();
}
return $aCases;
return $cases;
}
/**

View File

@@ -115,13 +115,23 @@ class AppThread extends BaseAppThread
}
}
public function countStatus($appUid, $status='OPEN'){
/**
* Count the open threads
*
* @param string $appUid
* @param string $status
*
* @return integer
*/
public static function countStatus($appUid, $status = 'OPEN')
{
$c = new Criteria('workflow');
$c->clearSelectColumns();
$c->addSelectColumn( AppThreadPeer::APP_THREAD_PARENT );
$c->add(AppThreadPeer::APP_UID, $appUid );
$c->add(AppThreadPeer::APP_THREAD_STATUS , $status );
$c->addSelectColumn(AppThreadPeer::APP_THREAD_PARENT);
$c->add(AppThreadPeer::APP_UID, $appUid);
$c->add(AppThreadPeer::APP_THREAD_STATUS, $status);
$cant = AppThreadPeer::doCount($c);
return $cant;
}
}

View File

@@ -46,9 +46,10 @@ class Application extends BaseApplication
* This value goes in the content table
* @var string
*/
const APP_STATUS_CANCELLED = 'CANCELLED';
public static $app_status_values = ['DRAFT' => 1, 'TO_DO' => 2, 'COMPLETED' => 3, 'CANCELLED' => 4];
protected $app_title_content = '';
protected $app_description_content = '';
public static $app_status_values = ['DRAFT' => 1, 'TO_DO' => 2, 'COMPLETED' => 3, 'CANCELLED' => 4];
/**
* Get the [app_title_content] column value.

View File

@@ -2,29 +2,17 @@
require_once 'classes/model/om/BaseListCanceled.php';
/**
* Skeleton subclass for representing a row from the 'LIST_CANCELED' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
// @codingStandardsIgnoreStart
class ListCanceled extends BaseListCanceled implements ListInterface
{
use ListBaseTrait;
// @codingStandardsIgnoreEnd
/**
* Create List Canceled Table
*
* @param type $data
* @return type
* @param array $data
*
* @return void
* @throws Exception
*
*/
public function create($data)
@@ -182,16 +170,17 @@ class ListCanceled extends BaseListCanceled implements ListInterface
/**
* Remove List Canceled
*
* @param type $seqName
* @return type
* @throws type
* @param string $appUid
*
* @return void
* @throws Exception
*
*/
public function remove($app_uid)
public function remove($appUid)
{
$con = Propel::getConnection(ListCanceledPeer::DATABASE_NAME);
try {
$this->setAppUid($app_uid);
$this->setAppUid($appUid);
$con->begin();
$this->delete();
$con->commit();
@@ -351,4 +340,5 @@ class ListCanceled extends BaseListCanceled implements ListInterface
return $this->getCountListFromPeer
(ListCanceledPeer::class, $usrUid, $filters);
}
} // ListCanceled

View File

@@ -111,5 +111,22 @@ class SubApplication extends BaseSubApplication
}
return false;
}
/**
* Verify if is a case related to the subProcess
*
* @param string $appUid
*
* @return boolean
*/
public static function isCaseSubProcess($appUid)
{
$criteria = new Criteria('workflow');
$criteria->add(SubApplicationPeer::APP_UID, $appUid);
$criteria->add(SubApplicationPeer::SA_STATUS, 'ACTIVE');
$dataset = SubApplicationPeer::doSelectOne($criteria);
return !is_null($dataset);
}
}

View File

@@ -67,6 +67,8 @@ class ListCanceledMapBuilder
$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);
@@ -83,8 +85,6 @@ class ListCanceledMapBuilder
$tMap->addColumn('APP_CANCELED_DATE', 'AppCanceledDate', 'int', CreoleTypes::TIMESTAMP, false, 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);

View File

@@ -33,6 +33,12 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
*/
protected $app_uid = '';
/**
* The value for the del_index field.
* @var int
*/
protected $del_index = 0;
/**
* The value for the usr_uid field.
* @var string
@@ -81,12 +87,6 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
*/
protected $app_canceled_date;
/**
* The value for the del_index field.
* @var int
*/
protected $del_index = 0;
/**
* The value for the del_previous_usr_uid field.
* @var string
@@ -178,6 +178,17 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
return $this->app_uid;
}
/**
* Get the [del_index] column value.
*
* @return int
*/
public function getDelIndex()
{
return $this->del_index;
}
/**
* Get the [usr_uid] column value.
*
@@ -287,17 +298,6 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
}
}
/**
* Get the [del_index] column value.
*
* @return int
*/
public function getDelIndex()
{
return $this->del_index;
}
/**
* Get the [del_previous_usr_uid] column value.
*
@@ -504,6 +504,28 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
} // 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[] = ListCanceledPeer::DEL_INDEX;
}
} // setDelIndex()
/**
* Set the value of [usr_uid] column.
*
@@ -687,28 +709,6 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
} // 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.
*
@@ -991,23 +991,23 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
$this->app_uid = $rs->getString($startcol + 0);
$this->usr_uid = $rs->getString($startcol + 1);
$this->del_index = $rs->getInt($startcol + 1);
$this->tas_uid = $rs->getString($startcol + 2);
$this->usr_uid = $rs->getString($startcol + 2);
$this->pro_uid = $rs->getString($startcol + 3);
$this->tas_uid = $rs->getString($startcol + 3);
$this->app_number = $rs->getInt($startcol + 4);
$this->pro_uid = $rs->getString($startcol + 4);
$this->app_title = $rs->getString($startcol + 5);
$this->app_number = $rs->getInt($startcol + 5);
$this->app_pro_title = $rs->getString($startcol + 6);
$this->app_title = $rs->getString($startcol + 6);
$this->app_tas_title = $rs->getString($startcol + 7);
$this->app_pro_title = $rs->getString($startcol + 7);
$this->app_canceled_date = $rs->getTimestamp($startcol + 8, null);
$this->app_tas_title = $rs->getString($startcol + 8);
$this->del_index = $rs->getInt($startcol + 9);
$this->app_canceled_date = $rs->getTimestamp($startcol + 9, null);
$this->del_previous_usr_uid = $rs->getString($startcol + 10);
@@ -1244,31 +1244,31 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
return $this->getAppUid();
break;
case 1:
return $this->getUsrUid();
return $this->getDelIndex();
break;
case 2:
return $this->getTasUid();
return $this->getUsrUid();
break;
case 3:
return $this->getProUid();
return $this->getTasUid();
break;
case 4:
return $this->getAppNumber();
return $this->getProUid();
break;
case 5:
return $this->getAppTitle();
return $this->getAppNumber();
break;
case 6:
return $this->getAppProTitle();
return $this->getAppTitle();
break;
case 7:
return $this->getAppTasTitle();
return $this->getAppProTitle();
break;
case 8:
return $this->getAppCanceledDate();
return $this->getAppTasTitle();
break;
case 9:
return $this->getDelIndex();
return $this->getAppCanceledDate();
break;
case 10:
return $this->getDelPreviousUsrUid();
@@ -1324,15 +1324,15 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
$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[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->getAppCanceledDate(),
$keys[10] => $this->getDelPreviousUsrUid(),
$keys[11] => $this->getDelCurrentUsrUsername(),
$keys[12] => $this->getDelCurrentUsrFirstname(),
@@ -1379,31 +1379,31 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
$this->setAppUid($value);
break;
case 1:
$this->setUsrUid($value);
$this->setDelIndex($value);
break;
case 2:
$this->setTasUid($value);
$this->setUsrUid($value);
break;
case 3:
$this->setProUid($value);
$this->setTasUid($value);
break;
case 4:
$this->setAppNumber($value);
$this->setProUid($value);
break;
case 5:
$this->setAppTitle($value);
$this->setAppNumber($value);
break;
case 6:
$this->setAppProTitle($value);
$this->setAppTitle($value);
break;
case 7:
$this->setAppTasTitle($value);
$this->setAppProTitle($value);
break;
case 8:
$this->setAppCanceledDate($value);
$this->setAppTasTitle($value);
break;
case 9:
$this->setDelIndex($value);
$this->setAppCanceledDate($value);
break;
case 10:
$this->setDelPreviousUsrUid($value);
@@ -1466,39 +1466,39 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
}
if (array_key_exists($keys[1], $arr)) {
$this->setUsrUid($arr[$keys[1]]);
$this->setDelIndex($arr[$keys[1]]);
}
if (array_key_exists($keys[2], $arr)) {
$this->setTasUid($arr[$keys[2]]);
$this->setUsrUid($arr[$keys[2]]);
}
if (array_key_exists($keys[3], $arr)) {
$this->setProUid($arr[$keys[3]]);
$this->setTasUid($arr[$keys[3]]);
}
if (array_key_exists($keys[4], $arr)) {
$this->setAppNumber($arr[$keys[4]]);
$this->setProUid($arr[$keys[4]]);
}
if (array_key_exists($keys[5], $arr)) {
$this->setAppTitle($arr[$keys[5]]);
$this->setAppNumber($arr[$keys[5]]);
}
if (array_key_exists($keys[6], $arr)) {
$this->setAppProTitle($arr[$keys[6]]);
$this->setAppTitle($arr[$keys[6]]);
}
if (array_key_exists($keys[7], $arr)) {
$this->setAppTasTitle($arr[$keys[7]]);
$this->setAppProTitle($arr[$keys[7]]);
}
if (array_key_exists($keys[8], $arr)) {
$this->setAppCanceledDate($arr[$keys[8]]);
$this->setAppTasTitle($arr[$keys[8]]);
}
if (array_key_exists($keys[9], $arr)) {
$this->setDelIndex($arr[$keys[9]]);
$this->setAppCanceledDate($arr[$keys[9]]);
}
if (array_key_exists($keys[10], $arr)) {
@@ -1560,6 +1560,10 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
$criteria->add(ListCanceledPeer::APP_UID, $this->app_uid);
}
if ($this->isColumnModified(ListCanceledPeer::DEL_INDEX)) {
$criteria->add(ListCanceledPeer::DEL_INDEX, $this->del_index);
}
if ($this->isColumnModified(ListCanceledPeer::USR_UID)) {
$criteria->add(ListCanceledPeer::USR_UID, $this->usr_uid);
}
@@ -1592,10 +1596,6 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
$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);
}
@@ -1657,28 +1657,40 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
$criteria = new Criteria(ListCanceledPeer::DATABASE_NAME);
$criteria->add(ListCanceledPeer::APP_UID, $this->app_uid);
$criteria->add(ListCanceledPeer::DEL_INDEX, $this->del_index);
return $criteria;
}
/**
* Returns the primary key for this object (row).
* @return string
* 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()
{
return $this->getAppUid();
$pks = array();
$pks[0] = $this->getAppUid();
$pks[1] = $this->getDelIndex();
return $pks;
}
/**
* Generic method to set the primary key (app_uid column).
* Set the [composite] primary key.
*
* @param string $key Primary key.
* @param array $keys The elements of the composite key (order must match the order in XML file).
* @return void
*/
public function setPrimaryKey($key)
public function setPrimaryKey($keys)
{
$this->setAppUid($key);
$this->setAppUid($keys[0]);
$this->setDelIndex($keys[1]);
}
/**
@@ -1710,8 +1722,6 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
$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);
@@ -1739,6 +1749,8 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
$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
}
/**

View File

@@ -34,6 +34,9 @@ abstract class BaseListCanceledPeer
/** the column name for the APP_UID field */
const APP_UID = 'LIST_CANCELED.APP_UID';
/** the column name for the DEL_INDEX field */
const DEL_INDEX = 'LIST_CANCELED.DEL_INDEX';
/** the column name for the USR_UID field */
const USR_UID = 'LIST_CANCELED.USR_UID';
@@ -58,9 +61,6 @@ abstract class BaseListCanceledPeer
/** the column name for the APP_CANCELED_DATE field */
const APP_CANCELED_DATE = 'LIST_CANCELED.APP_CANCELED_DATE';
/** the column name for the DEL_INDEX field */
const DEL_INDEX = 'LIST_CANCELED.DEL_INDEX';
/** the column name for the DEL_PREVIOUS_USR_UID field */
const DEL_PREVIOUS_USR_UID = 'LIST_CANCELED.DEL_PREVIOUS_USR_UID';
@@ -105,9 +105,9 @@ abstract class BaseListCanceledPeer
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('AppUid', 'UsrUid', 'TasUid', 'ProUid', 'AppNumber', 'AppTitle', 'AppProTitle', 'AppTasTitle', 'AppCanceledDate', 'DelIndex', 'DelPreviousUsrUid', 'DelCurrentUsrUsername', 'DelCurrentUsrFirstname', 'DelCurrentUsrLastname', 'DelDelegateDate', 'DelInitDate', 'DelDueDate', 'DelPriority', 'ProId', 'UsrId', 'TasId', ),
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, ListCanceledPeer::PRO_ID, ListCanceledPeer::USR_ID, ListCanceledPeer::TAS_ID, ),
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', 'PRO_ID', 'USR_ID', 'TAS_ID', ),
BasePeer::TYPE_PHPNAME => array ('AppUid', 'DelIndex', 'UsrUid', 'TasUid', 'ProUid', 'AppNumber', 'AppTitle', 'AppProTitle', 'AppTasTitle', 'AppCanceledDate', 'DelPreviousUsrUid', 'DelCurrentUsrUsername', 'DelCurrentUsrFirstname', 'DelCurrentUsrLastname', 'DelDelegateDate', 'DelInitDate', 'DelDueDate', 'DelPriority', 'ProId', 'UsrId', 'TasId', ),
BasePeer::TYPE_COLNAME => array (ListCanceledPeer::APP_UID, ListCanceledPeer::DEL_INDEX, 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_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, ListCanceledPeer::PRO_ID, ListCanceledPeer::USR_ID, ListCanceledPeer::TAS_ID, ),
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_CANCELED_DATE', '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', 'PRO_ID', 'USR_ID', 'TAS_ID', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, )
);
@@ -118,9 +118,9 @@ abstract class BaseListCanceledPeer
* 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, 'ProId' => 18, 'UsrId' => 19, 'TasId' => 20, ),
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, ListCanceledPeer::PRO_ID => 18, ListCanceledPeer::USR_ID => 19, ListCanceledPeer::TAS_ID => 20, ),
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, 'PRO_ID' => 18, 'USR_ID' => 19, 'TAS_ID' => 20, ),
BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'DelIndex' => 1, 'UsrUid' => 2, 'TasUid' => 3, 'ProUid' => 4, 'AppNumber' => 5, 'AppTitle' => 6, 'AppProTitle' => 7, 'AppTasTitle' => 8, 'AppCanceledDate' => 9, 'DelPreviousUsrUid' => 10, 'DelCurrentUsrUsername' => 11, 'DelCurrentUsrFirstname' => 12, 'DelCurrentUsrLastname' => 13, 'DelDelegateDate' => 14, 'DelInitDate' => 15, 'DelDueDate' => 16, 'DelPriority' => 17, 'ProId' => 18, 'UsrId' => 19, 'TasId' => 20, ),
BasePeer::TYPE_COLNAME => array (ListCanceledPeer::APP_UID => 0, ListCanceledPeer::DEL_INDEX => 1, ListCanceledPeer::USR_UID => 2, ListCanceledPeer::TAS_UID => 3, ListCanceledPeer::PRO_UID => 4, ListCanceledPeer::APP_NUMBER => 5, ListCanceledPeer::APP_TITLE => 6, ListCanceledPeer::APP_PRO_TITLE => 7, ListCanceledPeer::APP_TAS_TITLE => 8, ListCanceledPeer::APP_CANCELED_DATE => 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, ListCanceledPeer::PRO_ID => 18, ListCanceledPeer::USR_ID => 19, ListCanceledPeer::TAS_ID => 20, ),
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_CANCELED_DATE' => 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, 'PRO_ID' => 18, 'USR_ID' => 19, 'TAS_ID' => 20, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, )
);
@@ -224,6 +224,8 @@ abstract class BaseListCanceledPeer
$criteria->addSelectColumn(ListCanceledPeer::APP_UID);
$criteria->addSelectColumn(ListCanceledPeer::DEL_INDEX);
$criteria->addSelectColumn(ListCanceledPeer::USR_UID);
$criteria->addSelectColumn(ListCanceledPeer::TAS_UID);
@@ -240,8 +242,6 @@ abstract class BaseListCanceledPeer
$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);
@@ -479,6 +479,9 @@ abstract class BaseListCanceledPeer
$comparison = $criteria->getComparison(ListCanceledPeer::APP_UID);
$selectCriteria->add(ListCanceledPeer::APP_UID, $criteria->remove(ListCanceledPeer::APP_UID), $comparison);
$comparison = $criteria->getComparison(ListCanceledPeer::DEL_INDEX);
$selectCriteria->add(ListCanceledPeer::DEL_INDEX, $criteria->remove(ListCanceledPeer::DEL_INDEX), $comparison);
} else {
$criteria = $values->buildCriteria(); // gets full criteria
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
@@ -540,7 +543,22 @@ abstract class BaseListCanceledPeer
} else {
// it must be the primary key
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(ListCanceledPeer::APP_UID, (array) $values, Criteria::IN);
// 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(ListCanceledPeer::APP_UID, $vals[0], Criteria::IN);
$criteria->add(ListCanceledPeer::DEL_INDEX, $vals[1], Criteria::IN);
}
// Set the correct dbName
@@ -600,51 +618,23 @@ abstract class BaseListCanceledPeer
}
/**
* Retrieve a single object by pkey.
*
* @param mixed $pk the primary key.
* @param Connection $con the connection to use
* Retrieve object using using composite pkey values.
* @param string $app_uid
* @param int $del_index
* @param Connection $con
* @return ListCanceled
*/
public static function retrieveByPK($pk, $con = null)
public static function retrieveByPK($app_uid, $del_index, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(ListCanceledPeer::DATABASE_NAME);
$criteria->add(ListCanceledPeer::APP_UID, $pk);
$criteria = new Criteria();
$criteria->add(ListCanceledPeer::APP_UID, $app_uid);
$criteria->add(ListCanceledPeer::DEL_INDEX, $del_index);
$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;
return !empty($v) ? $v[0] : null;
}
}