PMCORE-1345
This commit is contained in:
@@ -15,7 +15,7 @@ $factory->define(ProcessVariables::class, function (Faker $faker) {
|
|||||||
'VAR_SQL' => '',
|
'VAR_SQL' => '',
|
||||||
'VAR_NULL' => 0,
|
'VAR_NULL' => 0,
|
||||||
'VAR_DEFAULT' => '',
|
'VAR_DEFAULT' => '',
|
||||||
'VAR_ACCEPTED_VALUES' => '',
|
'VAR_ACCEPTED_VALUES' => '[]',
|
||||||
'INP_DOC_UID' => ''
|
'INP_DOC_UID' => ''
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,191 @@
|
|||||||
|
<?php
|
||||||
|
namespace ProcessMaker\BusinessModel;
|
||||||
|
|
||||||
|
use G;
|
||||||
|
use ProcessMaker\BusinessModel\Variable;
|
||||||
|
use ProcessMaker\Model\Process;
|
||||||
|
use ProcessMaker\Model\ProcessVariables;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @coversDefaultClass ProcessMaker\BusinessModel\Variables
|
||||||
|
*/
|
||||||
|
class VariableTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Test it create variables related to the process
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\BusinessModel\Variables::create()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_create_variable_by_process()
|
||||||
|
{
|
||||||
|
$process = factory(Process::class)->create();
|
||||||
|
|
||||||
|
factory(ProcessVariables::class)->create([
|
||||||
|
'PRJ_UID' => $process->PRO_UID,
|
||||||
|
'PRO_ID' => $process->PRO_ID,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
$properties = [
|
||||||
|
'VAR_UID' => G::generateUniqueID(),
|
||||||
|
'VAR_NAME' => 'var_test',
|
||||||
|
'VAR_FIELD_TYPE' => 'string',
|
||||||
|
'VAR_FIELD_SIZE' => 10,
|
||||||
|
'VAR_LABEL' => 'string',
|
||||||
|
'VAR_DBCONNECTION' => '',
|
||||||
|
'VAR_SQL' => '',
|
||||||
|
'VAR_NULL' => 0,
|
||||||
|
'VAR_DEFAULT' => '',
|
||||||
|
'VAR_ACCEPTED_VALUES' => '[]',
|
||||||
|
'INP_DOC_UID' => ''
|
||||||
|
];
|
||||||
|
|
||||||
|
$variable = new Variable();
|
||||||
|
$res = $variable->create($process->PRO_UID, $properties);
|
||||||
|
$this->assertNotEmpty($res);
|
||||||
|
$this->assertArrayHasKey('var_uid', $res, "The result does not contains 'var_uid' as key");
|
||||||
|
$this->assertArrayHasKey('prj_uid', $res, "The result does not contains 'prj_uid' as key");
|
||||||
|
$this->assertArrayHasKey('var_name', $res, "The result does not contains 'var_name' as key");
|
||||||
|
$this->assertArrayHasKey('var_field_type', $res, "The result does not contains 'var_field_type' as key");
|
||||||
|
$this->assertArrayHasKey('var_field_size', $res, "The result does not contains 'var_field_size' as key");
|
||||||
|
$this->assertArrayHasKey('var_label', $res, "The result does not contains 'var_label' as key");
|
||||||
|
$this->assertArrayHasKey('var_dbconnection', $res, "The result does not contains 'var_dbconnection' as key");
|
||||||
|
$this->assertArrayHasKey('var_dbconnection_label', $res, "The result does not contains 'var_dbconnection_label' as key");
|
||||||
|
$this->assertArrayHasKey('var_sql', $res, "The result does not contains 'var_sql' as key");
|
||||||
|
$this->assertArrayHasKey('var_null', $res, "The result does not contains 'var_null' as key");
|
||||||
|
$this->assertArrayHasKey('var_default', $res, "The result does not contains 'var_default' as key");
|
||||||
|
$this->assertArrayHasKey('var_accepted_values', $res, "The result does not contains 'var_accepted_values' as key");
|
||||||
|
$this->assertArrayHasKey('inp_doc_uid', $res, "The result does not contains 'inp_doc_uid' as key");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests the exception
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\BusinessModel\Variables::create()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_an_exception_when_var_name_is_empty()
|
||||||
|
{
|
||||||
|
$process = factory(Process::class)->create();
|
||||||
|
factory(ProcessVariables::class)->create([
|
||||||
|
'PRJ_UID' => $process->PRO_UID,
|
||||||
|
'PRO_ID' => $process->PRO_ID,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
$properties = [
|
||||||
|
'VAR_UID' => G::generateUniqueID(),
|
||||||
|
'VAR_NAME' => '',
|
||||||
|
'VAR_FIELD_TYPE' => 'string',
|
||||||
|
'VAR_FIELD_SIZE' => 10,
|
||||||
|
'VAR_LABEL' => 'string',
|
||||||
|
'VAR_DBCONNECTION' => '',
|
||||||
|
'VAR_SQL' => '',
|
||||||
|
'VAR_NULL' => 0,
|
||||||
|
'VAR_DEFAULT' => '',
|
||||||
|
'VAR_ACCEPTED_VALUES' => '[]',
|
||||||
|
'INP_DOC_UID' => ''
|
||||||
|
];
|
||||||
|
$variable = new Variable();
|
||||||
|
$this->expectExceptionMessage("**ID_CAN_NOT_BE_NULL**");
|
||||||
|
$res = $variable->create($process->PRO_UID, $properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests the exception
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\BusinessModel\Variables::create()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_an_exception_when_var_field_type_is_empty()
|
||||||
|
{
|
||||||
|
$process = factory(Process::class)->create();
|
||||||
|
factory(ProcessVariables::class)->create([
|
||||||
|
'PRJ_UID' => $process->PRO_UID,
|
||||||
|
'PRO_ID' => $process->PRO_ID,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
$properties = [
|
||||||
|
'VAR_UID' => G::generateUniqueID(),
|
||||||
|
'VAR_NAME' => 'var_test',
|
||||||
|
'VAR_FIELD_TYPE' => '',
|
||||||
|
'VAR_FIELD_SIZE' => 10,
|
||||||
|
'VAR_LABEL' => 'string',
|
||||||
|
'VAR_DBCONNECTION' => '',
|
||||||
|
'VAR_SQL' => '',
|
||||||
|
'VAR_NULL' => 0,
|
||||||
|
'VAR_DEFAULT' => '',
|
||||||
|
'VAR_ACCEPTED_VALUES' => '[]',
|
||||||
|
'INP_DOC_UID' => ''
|
||||||
|
];
|
||||||
|
$variable = new Variable();
|
||||||
|
$this->expectExceptionMessage("**ID_CAN_NOT_BE_NULL**");
|
||||||
|
$res = $variable->create($process->PRO_UID, $properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests the exception
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\BusinessModel\Variables::create()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_return_an_exception_when_var_label_is_empty()
|
||||||
|
{
|
||||||
|
$process = factory(Process::class)->create();
|
||||||
|
factory(ProcessVariables::class)->create([
|
||||||
|
'PRJ_UID' => $process->PRO_UID,
|
||||||
|
'PRO_ID' => $process->PRO_ID,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
$properties = [
|
||||||
|
'VAR_UID' => G::generateUniqueID(),
|
||||||
|
'VAR_NAME' => 'var_test',
|
||||||
|
'VAR_FIELD_TYPE' => 'string',
|
||||||
|
'VAR_FIELD_SIZE' => 10,
|
||||||
|
'VAR_LABEL' => '',
|
||||||
|
'VAR_DBCONNECTION' => '',
|
||||||
|
'VAR_SQL' => '',
|
||||||
|
'VAR_NULL' => 0,
|
||||||
|
'VAR_DEFAULT' => '',
|
||||||
|
'VAR_ACCEPTED_VALUES' => '[]',
|
||||||
|
'INP_DOC_UID' => ''
|
||||||
|
];
|
||||||
|
$variable = new Variable();
|
||||||
|
$this->expectExceptionMessage("**ID_CAN_NOT_BE_NULL**");
|
||||||
|
$res = $variable->create($process->PRO_UID, $properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test it return the variables related to the PRO_UID
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\BusinessModel\Variables::getVariables()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_list_variables_by_process()
|
||||||
|
{
|
||||||
|
$process = factory(Process::class)->create();
|
||||||
|
|
||||||
|
factory(ProcessVariables::class)->create([
|
||||||
|
'PRJ_UID' => $process->PRO_UID,
|
||||||
|
'PRO_ID' => $process->PRO_ID,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
$variable = new Variable();
|
||||||
|
$res = $variable->getVariables($process->PRO_UID);
|
||||||
|
$this->assertNotEmpty($res);
|
||||||
|
$res = head($res);
|
||||||
|
$this->assertArrayHasKey('var_uid', $res, "The result does not contains 'var_uid' as key");
|
||||||
|
$this->assertArrayHasKey('prj_uid', $res, "The result does not contains 'prj_uid' as key");
|
||||||
|
$this->assertArrayHasKey('var_name', $res, "The result does not contains 'var_name' as key");
|
||||||
|
$this->assertArrayHasKey('var_field_type', $res, "The result does not contains 'var_field_type' as key");
|
||||||
|
$this->assertArrayHasKey('var_field_size', $res, "The result does not contains 'var_field_size' as key");
|
||||||
|
$this->assertArrayHasKey('var_label', $res, "The result does not contains 'var_label' as key");
|
||||||
|
$this->assertArrayHasKey('var_dbconnection', $res, "The result does not contains 'var_dbconnection' as key");
|
||||||
|
$this->assertArrayHasKey('var_dbconnection_label', $res, "The result does not contains 'var_dbconnection_label' as key");
|
||||||
|
$this->assertArrayHasKey('var_sql', $res, "The result does not contains 'var_sql' as key");
|
||||||
|
$this->assertArrayHasKey('var_null', $res, "The result does not contains 'var_null' as key");
|
||||||
|
$this->assertArrayHasKey('var_default', $res, "The result does not contains 'var_default' as key");
|
||||||
|
$this->assertArrayHasKey('var_accepted_values', $res, "The result does not contains 'var_accepted_values' as key");
|
||||||
|
$this->assertArrayHasKey('inp_doc_uid', $res, "The result does not contains 'inp_doc_uid' as key");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,9 @@ use ProcessMaker\Model\Process;
|
|||||||
use ProcessMaker\Model\ProcessVariables;
|
use ProcessMaker\Model\ProcessVariables;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @coversDefaultClass ProcessMaker\Model\ProcessVariables
|
||||||
|
*/
|
||||||
class ProcessVariablesTest extends TestCase
|
class ProcessVariablesTest extends TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -48,4 +51,23 @@ class ProcessVariablesTest extends TestCase
|
|||||||
$this->assertEquals($process[0]['PRO_UID'], $result[0]['PRJ_UID']);
|
$this->assertEquals($process[0]['PRO_UID'], $result[0]['PRJ_UID']);
|
||||||
$this->assertEquals($process[0]['PRO_UID'], $result[1]['PRJ_UID']);
|
$this->assertEquals($process[0]['PRO_UID'], $result[1]['PRJ_UID']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test it return the variables related to the PRO_ID
|
||||||
|
*
|
||||||
|
* @covers \ProcessMaker\Model\ProcessVariables::getVariables()
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_list_variables_by_process()
|
||||||
|
{
|
||||||
|
$process = factory(Process::class)->create();
|
||||||
|
|
||||||
|
factory(ProcessVariables::class)->create([
|
||||||
|
'PRJ_UID' => $process->PRO_UID,
|
||||||
|
'PRO_ID' => $process->PRO_ID,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
$result = ProcessVariables::getVariables($process->PRO_ID);
|
||||||
|
$this->assertNotEmpty($result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -4260,6 +4260,57 @@ class WorkspaceTools
|
|||||||
$con->commit();
|
$con->commit();
|
||||||
CLI::logging("-> Populating APP_ASSIGN_SELF_SERVICE_VALUE.TAS_ID Done \n");
|
CLI::logging("-> Populating APP_ASSIGN_SELF_SERVICE_VALUE.TAS_ID Done \n");
|
||||||
|
|
||||||
|
// Populating PROCESS_VARIABLES.PRO_ID
|
||||||
|
CLI::logging("-> Populating PROCESS_VARIABLES.PRO_ID \n");
|
||||||
|
$con->begin();
|
||||||
|
$stmt = $con->createStatement();
|
||||||
|
$rs = $stmt->executeQuery("UPDATE PROCESS_VARIABLES AS PV
|
||||||
|
INNER JOIN (
|
||||||
|
SELECT PROCESS.PRO_UID, PROCESS.PRO_ID
|
||||||
|
FROM PROCESS
|
||||||
|
) AS PRO
|
||||||
|
ON (PV.PRJ_UID = PRO.PRO_UID)
|
||||||
|
SET PV.PRO_ID = PRO.PRO_ID
|
||||||
|
WHERE PV.PRO_ID = 0");
|
||||||
|
$con->commit();
|
||||||
|
CLI::logging("-> Populating PROCESS_VARIABLES.PRO_ID Done \n");
|
||||||
|
|
||||||
|
// Populating PROCESS_VARIABLES.VAR_FIELD_TYPE_ID
|
||||||
|
CLI::logging("-> Populating PROCESS_VARIABLES.VAR_FIELD_TYPE_ID \n");
|
||||||
|
$con->begin();
|
||||||
|
$stmt = $con->createStatement();
|
||||||
|
$rs = $stmt->executeQuery("UPDATE PROCESS_VARIABLES
|
||||||
|
SET VAR_FIELD_TYPE_ID = (case
|
||||||
|
when VAR_FIELD_TYPE = 'string' then 1
|
||||||
|
when VAR_FIELD_TYPE = 'integer' then 2
|
||||||
|
when VAR_FIELD_TYPE = 'float' then 3
|
||||||
|
when VAR_FIELD_TYPE = 'boolean' then 4
|
||||||
|
when VAR_FIELD_TYPE = 'datetime' then 5
|
||||||
|
when VAR_FIELD_TYPE = 'grid' then 6
|
||||||
|
when VAR_FIELD_TYPE = 'array' then 7
|
||||||
|
when VAR_FIELD_TYPE = 'file' then 8
|
||||||
|
when VAR_FIELD_TYPE = 'multiplefile' then 9
|
||||||
|
when VAR_FIELD_TYPE = 'object' then 10
|
||||||
|
end)
|
||||||
|
WHERE VAR_FIELD_TYPE_ID = 0");
|
||||||
|
$con->commit();
|
||||||
|
CLI::logging("-> Populating PROCESS_VARIABLES.VAR_FIELD_TYPE_ID Done \n");
|
||||||
|
|
||||||
|
// Populating DB_SOURCE.PRO_ID
|
||||||
|
CLI::logging("-> Populating DB_SOURCE.PRO_ID \n");
|
||||||
|
$con->begin();
|
||||||
|
$stmt = $con->createStatement();
|
||||||
|
$rs = $stmt->executeQuery("UPDATE DB_SOURCE AS DS
|
||||||
|
INNER JOIN (
|
||||||
|
SELECT PROCESS.PRO_UID, PROCESS.PRO_ID
|
||||||
|
FROM PROCESS
|
||||||
|
) AS PRO
|
||||||
|
ON (DS.PRO_UID = PRO.PRO_UID)
|
||||||
|
SET DS.PRO_ID = PRO.PRO_ID
|
||||||
|
WHERE DS.PRO_ID = 0");
|
||||||
|
$con->commit();
|
||||||
|
CLI::logging("-> Populating DB_SOURCE.PRO_ID Done \n");
|
||||||
|
|
||||||
//Complete all migrations
|
//Complete all migrations
|
||||||
CLI::logging("-> Migrating And Populating Indexing for avoiding the use of table APP_CACHE_VIEW Done \n");
|
CLI::logging("-> Migrating And Populating Indexing for avoiding the use of table APP_CACHE_VIEW Done \n");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,12 +63,16 @@ class DbSourceMapBuilder
|
|||||||
$tMap = $this->dbMap->addTable('DB_SOURCE');
|
$tMap = $this->dbMap->addTable('DB_SOURCE');
|
||||||
$tMap->setPhpName('DbSource');
|
$tMap->setPhpName('DbSource');
|
||||||
|
|
||||||
$tMap->setUseIdGenerator(false);
|
$tMap->setUseIdGenerator(true);
|
||||||
|
|
||||||
|
$tMap->addColumn('DBS_ID', 'DbsId', 'int', CreoleTypes::INTEGER, true, null);
|
||||||
|
|
||||||
$tMap->addPrimaryKey('DBS_UID', 'DbsUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
$tMap->addPrimaryKey('DBS_UID', 'DbsUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||||
|
|
||||||
$tMap->addPrimaryKey('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
$tMap->addPrimaryKey('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||||
|
|
||||||
|
$tMap->addColumn('PRO_ID', 'ProId', 'int', CreoleTypes::INTEGER, false, null);
|
||||||
|
|
||||||
$tMap->addColumn('DBS_TYPE', 'DbsType', 'string', CreoleTypes::VARCHAR, true, 8);
|
$tMap->addColumn('DBS_TYPE', 'DbsType', 'string', CreoleTypes::VARCHAR, true, 8);
|
||||||
|
|
||||||
$tMap->addColumn('DBS_SERVER', 'DbsServer', 'string', CreoleTypes::VARCHAR, true, 100);
|
$tMap->addColumn('DBS_SERVER', 'DbsServer', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||||
|
|||||||
@@ -63,16 +63,22 @@ class ProcessVariablesMapBuilder
|
|||||||
$tMap = $this->dbMap->addTable('PROCESS_VARIABLES');
|
$tMap = $this->dbMap->addTable('PROCESS_VARIABLES');
|
||||||
$tMap->setPhpName('ProcessVariables');
|
$tMap->setPhpName('ProcessVariables');
|
||||||
|
|
||||||
$tMap->setUseIdGenerator(false);
|
$tMap->setUseIdGenerator(true);
|
||||||
|
|
||||||
|
$tMap->addColumn('VAR_ID', 'VarId', 'int', CreoleTypes::INTEGER, true, null);
|
||||||
|
|
||||||
$tMap->addPrimaryKey('VAR_UID', 'VarUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
$tMap->addPrimaryKey('VAR_UID', 'VarUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||||
|
|
||||||
$tMap->addColumn('PRJ_UID', 'PrjUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
$tMap->addColumn('PRJ_UID', 'PrjUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||||
|
|
||||||
|
$tMap->addColumn('PRO_ID', 'ProId', 'int', CreoleTypes::INTEGER, false, null);
|
||||||
|
|
||||||
$tMap->addColumn('VAR_NAME', 'VarName', 'string', CreoleTypes::VARCHAR, false, 255);
|
$tMap->addColumn('VAR_NAME', 'VarName', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||||
|
|
||||||
$tMap->addColumn('VAR_FIELD_TYPE', 'VarFieldType', 'string', CreoleTypes::VARCHAR, false, 32);
|
$tMap->addColumn('VAR_FIELD_TYPE', 'VarFieldType', 'string', CreoleTypes::VARCHAR, false, 32);
|
||||||
|
|
||||||
|
$tMap->addColumn('VAR_FIELD_TYPE_ID', 'VarFieldTypeId', 'int', CreoleTypes::INTEGER, false, null);
|
||||||
|
|
||||||
$tMap->addColumn('VAR_FIELD_SIZE', 'VarFieldSize', 'int', CreoleTypes::INTEGER, false, null);
|
$tMap->addColumn('VAR_FIELD_SIZE', 'VarFieldSize', 'int', CreoleTypes::INTEGER, false, null);
|
||||||
|
|
||||||
$tMap->addColumn('VAR_LABEL', 'VarLabel', 'string', CreoleTypes::VARCHAR, false, 255);
|
$tMap->addColumn('VAR_LABEL', 'VarLabel', 'string', CreoleTypes::VARCHAR, false, 255);
|
||||||
|
|||||||
@@ -27,6 +27,12 @@ abstract class BaseDbSource extends BaseObject implements Persistent
|
|||||||
*/
|
*/
|
||||||
protected static $peer;
|
protected static $peer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the dbs_id field.
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
protected $dbs_id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the dbs_uid field.
|
* The value for the dbs_uid field.
|
||||||
* @var string
|
* @var string
|
||||||
@@ -39,6 +45,12 @@ abstract class BaseDbSource extends BaseObject implements Persistent
|
|||||||
*/
|
*/
|
||||||
protected $pro_uid = '0';
|
protected $pro_uid = '0';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the pro_id field.
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
protected $pro_id = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the dbs_type field.
|
* The value for the dbs_type field.
|
||||||
* @var string
|
* @var string
|
||||||
@@ -107,6 +119,17 @@ abstract class BaseDbSource extends BaseObject implements Persistent
|
|||||||
*/
|
*/
|
||||||
protected $alreadyInValidation = false;
|
protected $alreadyInValidation = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [dbs_id] column value.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getDbsId()
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->dbs_id;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the [dbs_uid] column value.
|
* Get the [dbs_uid] column value.
|
||||||
*
|
*
|
||||||
@@ -129,6 +152,17 @@ abstract class BaseDbSource extends BaseObject implements Persistent
|
|||||||
return $this->pro_uid;
|
return $this->pro_uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [pro_id] column value.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getProId()
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->pro_id;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the [dbs_type] column value.
|
* Get the [dbs_type] column value.
|
||||||
*
|
*
|
||||||
@@ -228,6 +262,28 @@ abstract class BaseDbSource extends BaseObject implements Persistent
|
|||||||
return $this->dbs_tns;
|
return $this->dbs_tns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [dbs_id] column.
|
||||||
|
*
|
||||||
|
* @param int $v new value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setDbsId($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->dbs_id !== $v) {
|
||||||
|
$this->dbs_id = $v;
|
||||||
|
$this->modifiedColumns[] = DbSourcePeer::DBS_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // setDbsId()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value of [dbs_uid] column.
|
* Set the value of [dbs_uid] column.
|
||||||
*
|
*
|
||||||
@@ -272,6 +328,28 @@ abstract class BaseDbSource extends BaseObject implements Persistent
|
|||||||
|
|
||||||
} // setProUid()
|
} // setProUid()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [pro_id] column.
|
||||||
|
*
|
||||||
|
* @param int $v new value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setProId($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->pro_id !== $v || $v === 0) {
|
||||||
|
$this->pro_id = $v;
|
||||||
|
$this->modifiedColumns[] = DbSourcePeer::PRO_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // setProId()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value of [dbs_type] column.
|
* Set the value of [dbs_type] column.
|
||||||
*
|
*
|
||||||
@@ -487,34 +565,38 @@ abstract class BaseDbSource extends BaseObject implements Persistent
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$this->dbs_uid = $rs->getString($startcol + 0);
|
$this->dbs_id = $rs->getInt($startcol + 0);
|
||||||
|
|
||||||
$this->pro_uid = $rs->getString($startcol + 1);
|
$this->dbs_uid = $rs->getString($startcol + 1);
|
||||||
|
|
||||||
$this->dbs_type = $rs->getString($startcol + 2);
|
$this->pro_uid = $rs->getString($startcol + 2);
|
||||||
|
|
||||||
$this->dbs_server = $rs->getString($startcol + 3);
|
$this->pro_id = $rs->getInt($startcol + 3);
|
||||||
|
|
||||||
$this->dbs_database_name = $rs->getString($startcol + 4);
|
$this->dbs_type = $rs->getString($startcol + 4);
|
||||||
|
|
||||||
$this->dbs_username = $rs->getString($startcol + 5);
|
$this->dbs_server = $rs->getString($startcol + 5);
|
||||||
|
|
||||||
$this->dbs_password = $rs->getString($startcol + 6);
|
$this->dbs_database_name = $rs->getString($startcol + 6);
|
||||||
|
|
||||||
$this->dbs_port = $rs->getInt($startcol + 7);
|
$this->dbs_username = $rs->getString($startcol + 7);
|
||||||
|
|
||||||
$this->dbs_encode = $rs->getString($startcol + 8);
|
$this->dbs_password = $rs->getString($startcol + 8);
|
||||||
|
|
||||||
$this->dbs_connection_type = $rs->getString($startcol + 9);
|
$this->dbs_port = $rs->getInt($startcol + 9);
|
||||||
|
|
||||||
$this->dbs_tns = $rs->getString($startcol + 10);
|
$this->dbs_encode = $rs->getString($startcol + 10);
|
||||||
|
|
||||||
|
$this->dbs_connection_type = $rs->getString($startcol + 11);
|
||||||
|
|
||||||
|
$this->dbs_tns = $rs->getString($startcol + 12);
|
||||||
|
|
||||||
$this->resetModified();
|
$this->resetModified();
|
||||||
|
|
||||||
$this->setNew(false);
|
$this->setNew(false);
|
||||||
|
|
||||||
// FIXME - using NUM_COLUMNS may be clearer.
|
// FIXME - using NUM_COLUMNS may be clearer.
|
||||||
return $startcol + 11; // 11 = DbSourcePeer::NUM_COLUMNS - DbSourcePeer::NUM_LAZY_LOAD_COLUMNS).
|
return $startcol + 13; // 13 = DbSourcePeer::NUM_COLUMNS - DbSourcePeer::NUM_LAZY_LOAD_COLUMNS).
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new PropelException("Error populating DbSource object", $e);
|
throw new PropelException("Error populating DbSource object", $e);
|
||||||
@@ -719,36 +801,42 @@ abstract class BaseDbSource extends BaseObject implements Persistent
|
|||||||
{
|
{
|
||||||
switch($pos) {
|
switch($pos) {
|
||||||
case 0:
|
case 0:
|
||||||
return $this->getDbsUid();
|
return $this->getDbsId();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
return $this->getProUid();
|
return $this->getDbsUid();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
return $this->getDbsType();
|
return $this->getProUid();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
return $this->getDbsServer();
|
return $this->getProId();
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
return $this->getDbsDatabaseName();
|
return $this->getDbsType();
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
return $this->getDbsUsername();
|
return $this->getDbsServer();
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
return $this->getDbsPassword();
|
return $this->getDbsDatabaseName();
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
return $this->getDbsPort();
|
return $this->getDbsUsername();
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
return $this->getDbsEncode();
|
return $this->getDbsPassword();
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
return $this->getDbsConnectionType();
|
return $this->getDbsPort();
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
|
return $this->getDbsEncode();
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
return $this->getDbsConnectionType();
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
return $this->getDbsTns();
|
return $this->getDbsTns();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -771,17 +859,19 @@ abstract class BaseDbSource extends BaseObject implements Persistent
|
|||||||
{
|
{
|
||||||
$keys = DbSourcePeer::getFieldNames($keyType);
|
$keys = DbSourcePeer::getFieldNames($keyType);
|
||||||
$result = array(
|
$result = array(
|
||||||
$keys[0] => $this->getDbsUid(),
|
$keys[0] => $this->getDbsId(),
|
||||||
$keys[1] => $this->getProUid(),
|
$keys[1] => $this->getDbsUid(),
|
||||||
$keys[2] => $this->getDbsType(),
|
$keys[2] => $this->getProUid(),
|
||||||
$keys[3] => $this->getDbsServer(),
|
$keys[3] => $this->getProId(),
|
||||||
$keys[4] => $this->getDbsDatabaseName(),
|
$keys[4] => $this->getDbsType(),
|
||||||
$keys[5] => $this->getDbsUsername(),
|
$keys[5] => $this->getDbsServer(),
|
||||||
$keys[6] => $this->getDbsPassword(),
|
$keys[6] => $this->getDbsDatabaseName(),
|
||||||
$keys[7] => $this->getDbsPort(),
|
$keys[7] => $this->getDbsUsername(),
|
||||||
$keys[8] => $this->getDbsEncode(),
|
$keys[8] => $this->getDbsPassword(),
|
||||||
$keys[9] => $this->getDbsConnectionType(),
|
$keys[9] => $this->getDbsPort(),
|
||||||
$keys[10] => $this->getDbsTns(),
|
$keys[10] => $this->getDbsEncode(),
|
||||||
|
$keys[11] => $this->getDbsConnectionType(),
|
||||||
|
$keys[12] => $this->getDbsTns(),
|
||||||
);
|
);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@@ -814,36 +904,42 @@ abstract class BaseDbSource extends BaseObject implements Persistent
|
|||||||
{
|
{
|
||||||
switch($pos) {
|
switch($pos) {
|
||||||
case 0:
|
case 0:
|
||||||
$this->setDbsUid($value);
|
$this->setDbsId($value);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
$this->setProUid($value);
|
$this->setDbsUid($value);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
$this->setDbsType($value);
|
$this->setProUid($value);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
$this->setDbsServer($value);
|
$this->setProId($value);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
$this->setDbsDatabaseName($value);
|
$this->setDbsType($value);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
$this->setDbsUsername($value);
|
$this->setDbsServer($value);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
$this->setDbsPassword($value);
|
$this->setDbsDatabaseName($value);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
$this->setDbsPort($value);
|
$this->setDbsUsername($value);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
$this->setDbsEncode($value);
|
$this->setDbsPassword($value);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
$this->setDbsConnectionType($value);
|
$this->setDbsPort($value);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
|
$this->setDbsEncode($value);
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
$this->setDbsConnectionType($value);
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
$this->setDbsTns($value);
|
$this->setDbsTns($value);
|
||||||
break;
|
break;
|
||||||
} // switch()
|
} // switch()
|
||||||
@@ -870,47 +966,55 @@ abstract class BaseDbSource extends BaseObject implements Persistent
|
|||||||
$keys = DbSourcePeer::getFieldNames($keyType);
|
$keys = DbSourcePeer::getFieldNames($keyType);
|
||||||
|
|
||||||
if (array_key_exists($keys[0], $arr)) {
|
if (array_key_exists($keys[0], $arr)) {
|
||||||
$this->setDbsUid($arr[$keys[0]]);
|
$this->setDbsId($arr[$keys[0]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[1], $arr)) {
|
if (array_key_exists($keys[1], $arr)) {
|
||||||
$this->setProUid($arr[$keys[1]]);
|
$this->setDbsUid($arr[$keys[1]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[2], $arr)) {
|
if (array_key_exists($keys[2], $arr)) {
|
||||||
$this->setDbsType($arr[$keys[2]]);
|
$this->setProUid($arr[$keys[2]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[3], $arr)) {
|
if (array_key_exists($keys[3], $arr)) {
|
||||||
$this->setDbsServer($arr[$keys[3]]);
|
$this->setProId($arr[$keys[3]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[4], $arr)) {
|
if (array_key_exists($keys[4], $arr)) {
|
||||||
$this->setDbsDatabaseName($arr[$keys[4]]);
|
$this->setDbsType($arr[$keys[4]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[5], $arr)) {
|
if (array_key_exists($keys[5], $arr)) {
|
||||||
$this->setDbsUsername($arr[$keys[5]]);
|
$this->setDbsServer($arr[$keys[5]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[6], $arr)) {
|
if (array_key_exists($keys[6], $arr)) {
|
||||||
$this->setDbsPassword($arr[$keys[6]]);
|
$this->setDbsDatabaseName($arr[$keys[6]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[7], $arr)) {
|
if (array_key_exists($keys[7], $arr)) {
|
||||||
$this->setDbsPort($arr[$keys[7]]);
|
$this->setDbsUsername($arr[$keys[7]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[8], $arr)) {
|
if (array_key_exists($keys[8], $arr)) {
|
||||||
$this->setDbsEncode($arr[$keys[8]]);
|
$this->setDbsPassword($arr[$keys[8]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[9], $arr)) {
|
if (array_key_exists($keys[9], $arr)) {
|
||||||
$this->setDbsConnectionType($arr[$keys[9]]);
|
$this->setDbsPort($arr[$keys[9]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[10], $arr)) {
|
if (array_key_exists($keys[10], $arr)) {
|
||||||
$this->setDbsTns($arr[$keys[10]]);
|
$this->setDbsEncode($arr[$keys[10]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[11], $arr)) {
|
||||||
|
$this->setDbsConnectionType($arr[$keys[11]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[12], $arr)) {
|
||||||
|
$this->setDbsTns($arr[$keys[12]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -924,6 +1028,10 @@ abstract class BaseDbSource extends BaseObject implements Persistent
|
|||||||
{
|
{
|
||||||
$criteria = new Criteria(DbSourcePeer::DATABASE_NAME);
|
$criteria = new Criteria(DbSourcePeer::DATABASE_NAME);
|
||||||
|
|
||||||
|
if ($this->isColumnModified(DbSourcePeer::DBS_ID)) {
|
||||||
|
$criteria->add(DbSourcePeer::DBS_ID, $this->dbs_id);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->isColumnModified(DbSourcePeer::DBS_UID)) {
|
if ($this->isColumnModified(DbSourcePeer::DBS_UID)) {
|
||||||
$criteria->add(DbSourcePeer::DBS_UID, $this->dbs_uid);
|
$criteria->add(DbSourcePeer::DBS_UID, $this->dbs_uid);
|
||||||
}
|
}
|
||||||
@@ -932,6 +1040,10 @@ abstract class BaseDbSource extends BaseObject implements Persistent
|
|||||||
$criteria->add(DbSourcePeer::PRO_UID, $this->pro_uid);
|
$criteria->add(DbSourcePeer::PRO_UID, $this->pro_uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->isColumnModified(DbSourcePeer::PRO_ID)) {
|
||||||
|
$criteria->add(DbSourcePeer::PRO_ID, $this->pro_id);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->isColumnModified(DbSourcePeer::DBS_TYPE)) {
|
if ($this->isColumnModified(DbSourcePeer::DBS_TYPE)) {
|
||||||
$criteria->add(DbSourcePeer::DBS_TYPE, $this->dbs_type);
|
$criteria->add(DbSourcePeer::DBS_TYPE, $this->dbs_type);
|
||||||
}
|
}
|
||||||
@@ -1034,6 +1146,10 @@ abstract class BaseDbSource extends BaseObject implements Persistent
|
|||||||
public function copyInto($copyObj, $deepCopy = false)
|
public function copyInto($copyObj, $deepCopy = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$copyObj->setDbsId($this->dbs_id);
|
||||||
|
|
||||||
|
$copyObj->setProId($this->pro_id);
|
||||||
|
|
||||||
$copyObj->setDbsType($this->dbs_type);
|
$copyObj->setDbsType($this->dbs_type);
|
||||||
|
|
||||||
$copyObj->setDbsServer($this->dbs_server);
|
$copyObj->setDbsServer($this->dbs_server);
|
||||||
|
|||||||
@@ -25,18 +25,24 @@ abstract class BaseDbSourcePeer
|
|||||||
const CLASS_DEFAULT = 'classes.model.DbSource';
|
const CLASS_DEFAULT = 'classes.model.DbSource';
|
||||||
|
|
||||||
/** The total number of columns. */
|
/** The total number of columns. */
|
||||||
const NUM_COLUMNS = 11;
|
const NUM_COLUMNS = 13;
|
||||||
|
|
||||||
/** The number of lazy-loaded columns. */
|
/** The number of lazy-loaded columns. */
|
||||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||||
|
|
||||||
|
|
||||||
|
/** the column name for the DBS_ID field */
|
||||||
|
const DBS_ID = 'DB_SOURCE.DBS_ID';
|
||||||
|
|
||||||
/** the column name for the DBS_UID field */
|
/** the column name for the DBS_UID field */
|
||||||
const DBS_UID = 'DB_SOURCE.DBS_UID';
|
const DBS_UID = 'DB_SOURCE.DBS_UID';
|
||||||
|
|
||||||
/** the column name for the PRO_UID field */
|
/** the column name for the PRO_UID field */
|
||||||
const PRO_UID = 'DB_SOURCE.PRO_UID';
|
const PRO_UID = 'DB_SOURCE.PRO_UID';
|
||||||
|
|
||||||
|
/** the column name for the PRO_ID field */
|
||||||
|
const PRO_ID = 'DB_SOURCE.PRO_ID';
|
||||||
|
|
||||||
/** the column name for the DBS_TYPE field */
|
/** the column name for the DBS_TYPE field */
|
||||||
const DBS_TYPE = 'DB_SOURCE.DBS_TYPE';
|
const DBS_TYPE = 'DB_SOURCE.DBS_TYPE';
|
||||||
|
|
||||||
@@ -75,10 +81,10 @@ abstract class BaseDbSourcePeer
|
|||||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||||
*/
|
*/
|
||||||
private static $fieldNames = array (
|
private static $fieldNames = array (
|
||||||
BasePeer::TYPE_PHPNAME => array ('DbsUid', 'ProUid', 'DbsType', 'DbsServer', 'DbsDatabaseName', 'DbsUsername', 'DbsPassword', 'DbsPort', 'DbsEncode', 'DbsConnectionType', 'DbsTns', ),
|
BasePeer::TYPE_PHPNAME => array ('DbsId', 'DbsUid', 'ProUid', 'ProId', 'DbsType', 'DbsServer', 'DbsDatabaseName', 'DbsUsername', 'DbsPassword', 'DbsPort', 'DbsEncode', 'DbsConnectionType', 'DbsTns', ),
|
||||||
BasePeer::TYPE_COLNAME => array (DbSourcePeer::DBS_UID, DbSourcePeer::PRO_UID, DbSourcePeer::DBS_TYPE, DbSourcePeer::DBS_SERVER, DbSourcePeer::DBS_DATABASE_NAME, DbSourcePeer::DBS_USERNAME, DbSourcePeer::DBS_PASSWORD, DbSourcePeer::DBS_PORT, DbSourcePeer::DBS_ENCODE, DbSourcePeer::DBS_CONNECTION_TYPE, DbSourcePeer::DBS_TNS, ),
|
BasePeer::TYPE_COLNAME => array (DbSourcePeer::DBS_ID, DbSourcePeer::DBS_UID, DbSourcePeer::PRO_UID, DbSourcePeer::PRO_ID, DbSourcePeer::DBS_TYPE, DbSourcePeer::DBS_SERVER, DbSourcePeer::DBS_DATABASE_NAME, DbSourcePeer::DBS_USERNAME, DbSourcePeer::DBS_PASSWORD, DbSourcePeer::DBS_PORT, DbSourcePeer::DBS_ENCODE, DbSourcePeer::DBS_CONNECTION_TYPE, DbSourcePeer::DBS_TNS, ),
|
||||||
BasePeer::TYPE_FIELDNAME => array ('DBS_UID', 'PRO_UID', 'DBS_TYPE', 'DBS_SERVER', 'DBS_DATABASE_NAME', 'DBS_USERNAME', 'DBS_PASSWORD', 'DBS_PORT', 'DBS_ENCODE', 'DBS_CONNECTION_TYPE', 'DBS_TNS', ),
|
BasePeer::TYPE_FIELDNAME => array ('DBS_ID', 'DBS_UID', 'PRO_UID', 'PRO_ID', 'DBS_TYPE', 'DBS_SERVER', 'DBS_DATABASE_NAME', 'DBS_USERNAME', 'DBS_PASSWORD', 'DBS_PORT', 'DBS_ENCODE', 'DBS_CONNECTION_TYPE', 'DBS_TNS', ),
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, )
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -88,10 +94,10 @@ abstract class BaseDbSourcePeer
|
|||||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||||
*/
|
*/
|
||||||
private static $fieldKeys = array (
|
private static $fieldKeys = array (
|
||||||
BasePeer::TYPE_PHPNAME => array ('DbsUid' => 0, 'ProUid' => 1, 'DbsType' => 2, 'DbsServer' => 3, 'DbsDatabaseName' => 4, 'DbsUsername' => 5, 'DbsPassword' => 6, 'DbsPort' => 7, 'DbsEncode' => 8, 'DbsConnectionType' => 9, 'DbsTns' => 10, ),
|
BasePeer::TYPE_PHPNAME => array ('DbsId' => 0, 'DbsUid' => 1, 'ProUid' => 2, 'ProId' => 3, 'DbsType' => 4, 'DbsServer' => 5, 'DbsDatabaseName' => 6, 'DbsUsername' => 7, 'DbsPassword' => 8, 'DbsPort' => 9, 'DbsEncode' => 10, 'DbsConnectionType' => 11, 'DbsTns' => 12, ),
|
||||||
BasePeer::TYPE_COLNAME => array (DbSourcePeer::DBS_UID => 0, DbSourcePeer::PRO_UID => 1, DbSourcePeer::DBS_TYPE => 2, DbSourcePeer::DBS_SERVER => 3, DbSourcePeer::DBS_DATABASE_NAME => 4, DbSourcePeer::DBS_USERNAME => 5, DbSourcePeer::DBS_PASSWORD => 6, DbSourcePeer::DBS_PORT => 7, DbSourcePeer::DBS_ENCODE => 8, DbSourcePeer::DBS_CONNECTION_TYPE => 9, DbSourcePeer::DBS_TNS => 10, ),
|
BasePeer::TYPE_COLNAME => array (DbSourcePeer::DBS_ID => 0, DbSourcePeer::DBS_UID => 1, DbSourcePeer::PRO_UID => 2, DbSourcePeer::PRO_ID => 3, DbSourcePeer::DBS_TYPE => 4, DbSourcePeer::DBS_SERVER => 5, DbSourcePeer::DBS_DATABASE_NAME => 6, DbSourcePeer::DBS_USERNAME => 7, DbSourcePeer::DBS_PASSWORD => 8, DbSourcePeer::DBS_PORT => 9, DbSourcePeer::DBS_ENCODE => 10, DbSourcePeer::DBS_CONNECTION_TYPE => 11, DbSourcePeer::DBS_TNS => 12, ),
|
||||||
BasePeer::TYPE_FIELDNAME => array ('DBS_UID' => 0, 'PRO_UID' => 1, 'DBS_TYPE' => 2, 'DBS_SERVER' => 3, 'DBS_DATABASE_NAME' => 4, 'DBS_USERNAME' => 5, 'DBS_PASSWORD' => 6, 'DBS_PORT' => 7, 'DBS_ENCODE' => 8, 'DBS_CONNECTION_TYPE' => 9, 'DBS_TNS' => 10, ),
|
BasePeer::TYPE_FIELDNAME => array ('DBS_ID' => 0, 'DBS_UID' => 1, 'PRO_UID' => 2, 'PRO_ID' => 3, 'DBS_TYPE' => 4, 'DBS_SERVER' => 5, 'DBS_DATABASE_NAME' => 6, 'DBS_USERNAME' => 7, 'DBS_PASSWORD' => 8, 'DBS_PORT' => 9, 'DBS_ENCODE' => 10, 'DBS_CONNECTION_TYPE' => 11, 'DBS_TNS' => 12, ),
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, )
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -192,10 +198,14 @@ abstract class BaseDbSourcePeer
|
|||||||
public static function addSelectColumns(Criteria $criteria)
|
public static function addSelectColumns(Criteria $criteria)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(DbSourcePeer::DBS_ID);
|
||||||
|
|
||||||
$criteria->addSelectColumn(DbSourcePeer::DBS_UID);
|
$criteria->addSelectColumn(DbSourcePeer::DBS_UID);
|
||||||
|
|
||||||
$criteria->addSelectColumn(DbSourcePeer::PRO_UID);
|
$criteria->addSelectColumn(DbSourcePeer::PRO_UID);
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(DbSourcePeer::PRO_ID);
|
||||||
|
|
||||||
$criteria->addSelectColumn(DbSourcePeer::DBS_TYPE);
|
$criteria->addSelectColumn(DbSourcePeer::DBS_TYPE);
|
||||||
|
|
||||||
$criteria->addSelectColumn(DbSourcePeer::DBS_SERVER);
|
$criteria->addSelectColumn(DbSourcePeer::DBS_SERVER);
|
||||||
|
|||||||
@@ -27,6 +27,12 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
*/
|
*/
|
||||||
protected static $peer;
|
protected static $peer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the var_id field.
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
protected $var_id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the var_uid field.
|
* The value for the var_uid field.
|
||||||
* @var string
|
* @var string
|
||||||
@@ -39,6 +45,12 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
*/
|
*/
|
||||||
protected $prj_uid;
|
protected $prj_uid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the pro_id field.
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
protected $pro_id = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the var_name field.
|
* The value for the var_name field.
|
||||||
* @var string
|
* @var string
|
||||||
@@ -51,6 +63,12 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
*/
|
*/
|
||||||
protected $var_field_type = '';
|
protected $var_field_type = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the var_field_type_id field.
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
protected $var_field_type_id = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the var_field_size field.
|
* The value for the var_field_size field.
|
||||||
* @var int
|
* @var int
|
||||||
@@ -113,6 +131,17 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
*/
|
*/
|
||||||
protected $alreadyInValidation = false;
|
protected $alreadyInValidation = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [var_id] column value.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getVarId()
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->var_id;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the [var_uid] column value.
|
* Get the [var_uid] column value.
|
||||||
*
|
*
|
||||||
@@ -135,6 +164,17 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
return $this->prj_uid;
|
return $this->prj_uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [pro_id] column value.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getProId()
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->pro_id;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the [var_name] column value.
|
* Get the [var_name] column value.
|
||||||
*
|
*
|
||||||
@@ -157,6 +197,17 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
return $this->var_field_type;
|
return $this->var_field_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [var_field_type_id] column value.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getVarFieldTypeId()
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->var_field_type_id;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the [var_field_size] column value.
|
* Get the [var_field_size] column value.
|
||||||
*
|
*
|
||||||
@@ -245,6 +296,28 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
return $this->inp_doc_uid;
|
return $this->inp_doc_uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [var_id] column.
|
||||||
|
*
|
||||||
|
* @param int $v new value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setVarId($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->var_id !== $v) {
|
||||||
|
$this->var_id = $v;
|
||||||
|
$this->modifiedColumns[] = ProcessVariablesPeer::VAR_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // setVarId()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value of [var_uid] column.
|
* Set the value of [var_uid] column.
|
||||||
*
|
*
|
||||||
@@ -289,6 +362,28 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
|
|
||||||
} // setPrjUid()
|
} // setPrjUid()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [pro_id] column.
|
||||||
|
*
|
||||||
|
* @param int $v new value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setProId($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->pro_id !== $v || $v === 0) {
|
||||||
|
$this->pro_id = $v;
|
||||||
|
$this->modifiedColumns[] = ProcessVariablesPeer::PRO_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // setProId()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value of [var_name] column.
|
* Set the value of [var_name] column.
|
||||||
*
|
*
|
||||||
@@ -333,6 +428,28 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
|
|
||||||
} // setVarFieldType()
|
} // setVarFieldType()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [var_field_type_id] column.
|
||||||
|
*
|
||||||
|
* @param int $v new value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setVarFieldTypeId($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->var_field_type_id !== $v || $v === 0) {
|
||||||
|
$this->var_field_type_id = $v;
|
||||||
|
$this->modifiedColumns[] = ProcessVariablesPeer::VAR_FIELD_TYPE_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // setVarFieldTypeId()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value of [var_field_size] column.
|
* Set the value of [var_field_size] column.
|
||||||
*
|
*
|
||||||
@@ -526,36 +643,42 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$this->var_uid = $rs->getString($startcol + 0);
|
$this->var_id = $rs->getInt($startcol + 0);
|
||||||
|
|
||||||
$this->prj_uid = $rs->getString($startcol + 1);
|
$this->var_uid = $rs->getString($startcol + 1);
|
||||||
|
|
||||||
$this->var_name = $rs->getString($startcol + 2);
|
$this->prj_uid = $rs->getString($startcol + 2);
|
||||||
|
|
||||||
$this->var_field_type = $rs->getString($startcol + 3);
|
$this->pro_id = $rs->getInt($startcol + 3);
|
||||||
|
|
||||||
$this->var_field_size = $rs->getInt($startcol + 4);
|
$this->var_name = $rs->getString($startcol + 4);
|
||||||
|
|
||||||
$this->var_label = $rs->getString($startcol + 5);
|
$this->var_field_type = $rs->getString($startcol + 5);
|
||||||
|
|
||||||
$this->var_dbconnection = $rs->getString($startcol + 6);
|
$this->var_field_type_id = $rs->getInt($startcol + 6);
|
||||||
|
|
||||||
$this->var_sql = $rs->getString($startcol + 7);
|
$this->var_field_size = $rs->getInt($startcol + 7);
|
||||||
|
|
||||||
$this->var_null = $rs->getInt($startcol + 8);
|
$this->var_label = $rs->getString($startcol + 8);
|
||||||
|
|
||||||
$this->var_default = $rs->getString($startcol + 9);
|
$this->var_dbconnection = $rs->getString($startcol + 9);
|
||||||
|
|
||||||
$this->var_accepted_values = $rs->getString($startcol + 10);
|
$this->var_sql = $rs->getString($startcol + 10);
|
||||||
|
|
||||||
$this->inp_doc_uid = $rs->getString($startcol + 11);
|
$this->var_null = $rs->getInt($startcol + 11);
|
||||||
|
|
||||||
|
$this->var_default = $rs->getString($startcol + 12);
|
||||||
|
|
||||||
|
$this->var_accepted_values = $rs->getString($startcol + 13);
|
||||||
|
|
||||||
|
$this->inp_doc_uid = $rs->getString($startcol + 14);
|
||||||
|
|
||||||
$this->resetModified();
|
$this->resetModified();
|
||||||
|
|
||||||
$this->setNew(false);
|
$this->setNew(false);
|
||||||
|
|
||||||
// FIXME - using NUM_COLUMNS may be clearer.
|
// FIXME - using NUM_COLUMNS may be clearer.
|
||||||
return $startcol + 12; // 12 = ProcessVariablesPeer::NUM_COLUMNS - ProcessVariablesPeer::NUM_LAZY_LOAD_COLUMNS).
|
return $startcol + 15; // 15 = ProcessVariablesPeer::NUM_COLUMNS - ProcessVariablesPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new PropelException("Error populating ProcessVariables object", $e);
|
throw new PropelException("Error populating ProcessVariables object", $e);
|
||||||
@@ -760,39 +883,48 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
{
|
{
|
||||||
switch($pos) {
|
switch($pos) {
|
||||||
case 0:
|
case 0:
|
||||||
return $this->getVarUid();
|
return $this->getVarId();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
return $this->getPrjUid();
|
return $this->getVarUid();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
return $this->getVarName();
|
return $this->getPrjUid();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
return $this->getVarFieldType();
|
return $this->getProId();
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
return $this->getVarFieldSize();
|
return $this->getVarName();
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
return $this->getVarLabel();
|
return $this->getVarFieldType();
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
return $this->getVarDbconnection();
|
return $this->getVarFieldTypeId();
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
return $this->getVarSql();
|
return $this->getVarFieldSize();
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
return $this->getVarNull();
|
return $this->getVarLabel();
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
return $this->getVarDefault();
|
return $this->getVarDbconnection();
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
return $this->getVarAcceptedValues();
|
return $this->getVarSql();
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
|
return $this->getVarNull();
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
return $this->getVarDefault();
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
return $this->getVarAcceptedValues();
|
||||||
|
break;
|
||||||
|
case 14:
|
||||||
return $this->getInpDocUid();
|
return $this->getInpDocUid();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -815,18 +947,21 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
{
|
{
|
||||||
$keys = ProcessVariablesPeer::getFieldNames($keyType);
|
$keys = ProcessVariablesPeer::getFieldNames($keyType);
|
||||||
$result = array(
|
$result = array(
|
||||||
$keys[0] => $this->getVarUid(),
|
$keys[0] => $this->getVarId(),
|
||||||
$keys[1] => $this->getPrjUid(),
|
$keys[1] => $this->getVarUid(),
|
||||||
$keys[2] => $this->getVarName(),
|
$keys[2] => $this->getPrjUid(),
|
||||||
$keys[3] => $this->getVarFieldType(),
|
$keys[3] => $this->getProId(),
|
||||||
$keys[4] => $this->getVarFieldSize(),
|
$keys[4] => $this->getVarName(),
|
||||||
$keys[5] => $this->getVarLabel(),
|
$keys[5] => $this->getVarFieldType(),
|
||||||
$keys[6] => $this->getVarDbconnection(),
|
$keys[6] => $this->getVarFieldTypeId(),
|
||||||
$keys[7] => $this->getVarSql(),
|
$keys[7] => $this->getVarFieldSize(),
|
||||||
$keys[8] => $this->getVarNull(),
|
$keys[8] => $this->getVarLabel(),
|
||||||
$keys[9] => $this->getVarDefault(),
|
$keys[9] => $this->getVarDbconnection(),
|
||||||
$keys[10] => $this->getVarAcceptedValues(),
|
$keys[10] => $this->getVarSql(),
|
||||||
$keys[11] => $this->getInpDocUid(),
|
$keys[11] => $this->getVarNull(),
|
||||||
|
$keys[12] => $this->getVarDefault(),
|
||||||
|
$keys[13] => $this->getVarAcceptedValues(),
|
||||||
|
$keys[14] => $this->getInpDocUid(),
|
||||||
);
|
);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@@ -859,39 +994,48 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
{
|
{
|
||||||
switch($pos) {
|
switch($pos) {
|
||||||
case 0:
|
case 0:
|
||||||
$this->setVarUid($value);
|
$this->setVarId($value);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
$this->setPrjUid($value);
|
$this->setVarUid($value);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
$this->setVarName($value);
|
$this->setPrjUid($value);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
$this->setVarFieldType($value);
|
$this->setProId($value);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
$this->setVarFieldSize($value);
|
$this->setVarName($value);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
$this->setVarLabel($value);
|
$this->setVarFieldType($value);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
$this->setVarDbconnection($value);
|
$this->setVarFieldTypeId($value);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
$this->setVarSql($value);
|
$this->setVarFieldSize($value);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
$this->setVarNull($value);
|
$this->setVarLabel($value);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
$this->setVarDefault($value);
|
$this->setVarDbconnection($value);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
$this->setVarAcceptedValues($value);
|
$this->setVarSql($value);
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
|
$this->setVarNull($value);
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
$this->setVarDefault($value);
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
$this->setVarAcceptedValues($value);
|
||||||
|
break;
|
||||||
|
case 14:
|
||||||
$this->setInpDocUid($value);
|
$this->setInpDocUid($value);
|
||||||
break;
|
break;
|
||||||
} // switch()
|
} // switch()
|
||||||
@@ -918,51 +1062,63 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
$keys = ProcessVariablesPeer::getFieldNames($keyType);
|
$keys = ProcessVariablesPeer::getFieldNames($keyType);
|
||||||
|
|
||||||
if (array_key_exists($keys[0], $arr)) {
|
if (array_key_exists($keys[0], $arr)) {
|
||||||
$this->setVarUid($arr[$keys[0]]);
|
$this->setVarId($arr[$keys[0]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[1], $arr)) {
|
if (array_key_exists($keys[1], $arr)) {
|
||||||
$this->setPrjUid($arr[$keys[1]]);
|
$this->setVarUid($arr[$keys[1]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[2], $arr)) {
|
if (array_key_exists($keys[2], $arr)) {
|
||||||
$this->setVarName($arr[$keys[2]]);
|
$this->setPrjUid($arr[$keys[2]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[3], $arr)) {
|
if (array_key_exists($keys[3], $arr)) {
|
||||||
$this->setVarFieldType($arr[$keys[3]]);
|
$this->setProId($arr[$keys[3]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[4], $arr)) {
|
if (array_key_exists($keys[4], $arr)) {
|
||||||
$this->setVarFieldSize($arr[$keys[4]]);
|
$this->setVarName($arr[$keys[4]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[5], $arr)) {
|
if (array_key_exists($keys[5], $arr)) {
|
||||||
$this->setVarLabel($arr[$keys[5]]);
|
$this->setVarFieldType($arr[$keys[5]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[6], $arr)) {
|
if (array_key_exists($keys[6], $arr)) {
|
||||||
$this->setVarDbconnection($arr[$keys[6]]);
|
$this->setVarFieldTypeId($arr[$keys[6]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[7], $arr)) {
|
if (array_key_exists($keys[7], $arr)) {
|
||||||
$this->setVarSql($arr[$keys[7]]);
|
$this->setVarFieldSize($arr[$keys[7]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[8], $arr)) {
|
if (array_key_exists($keys[8], $arr)) {
|
||||||
$this->setVarNull($arr[$keys[8]]);
|
$this->setVarLabel($arr[$keys[8]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[9], $arr)) {
|
if (array_key_exists($keys[9], $arr)) {
|
||||||
$this->setVarDefault($arr[$keys[9]]);
|
$this->setVarDbconnection($arr[$keys[9]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[10], $arr)) {
|
if (array_key_exists($keys[10], $arr)) {
|
||||||
$this->setVarAcceptedValues($arr[$keys[10]]);
|
$this->setVarSql($arr[$keys[10]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[11], $arr)) {
|
if (array_key_exists($keys[11], $arr)) {
|
||||||
$this->setInpDocUid($arr[$keys[11]]);
|
$this->setVarNull($arr[$keys[11]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[12], $arr)) {
|
||||||
|
$this->setVarDefault($arr[$keys[12]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[13], $arr)) {
|
||||||
|
$this->setVarAcceptedValues($arr[$keys[13]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[14], $arr)) {
|
||||||
|
$this->setInpDocUid($arr[$keys[14]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -976,6 +1132,10 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
{
|
{
|
||||||
$criteria = new Criteria(ProcessVariablesPeer::DATABASE_NAME);
|
$criteria = new Criteria(ProcessVariablesPeer::DATABASE_NAME);
|
||||||
|
|
||||||
|
if ($this->isColumnModified(ProcessVariablesPeer::VAR_ID)) {
|
||||||
|
$criteria->add(ProcessVariablesPeer::VAR_ID, $this->var_id);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->isColumnModified(ProcessVariablesPeer::VAR_UID)) {
|
if ($this->isColumnModified(ProcessVariablesPeer::VAR_UID)) {
|
||||||
$criteria->add(ProcessVariablesPeer::VAR_UID, $this->var_uid);
|
$criteria->add(ProcessVariablesPeer::VAR_UID, $this->var_uid);
|
||||||
}
|
}
|
||||||
@@ -984,6 +1144,10 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
$criteria->add(ProcessVariablesPeer::PRJ_UID, $this->prj_uid);
|
$criteria->add(ProcessVariablesPeer::PRJ_UID, $this->prj_uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->isColumnModified(ProcessVariablesPeer::PRO_ID)) {
|
||||||
|
$criteria->add(ProcessVariablesPeer::PRO_ID, $this->pro_id);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->isColumnModified(ProcessVariablesPeer::VAR_NAME)) {
|
if ($this->isColumnModified(ProcessVariablesPeer::VAR_NAME)) {
|
||||||
$criteria->add(ProcessVariablesPeer::VAR_NAME, $this->var_name);
|
$criteria->add(ProcessVariablesPeer::VAR_NAME, $this->var_name);
|
||||||
}
|
}
|
||||||
@@ -992,6 +1156,10 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
$criteria->add(ProcessVariablesPeer::VAR_FIELD_TYPE, $this->var_field_type);
|
$criteria->add(ProcessVariablesPeer::VAR_FIELD_TYPE, $this->var_field_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->isColumnModified(ProcessVariablesPeer::VAR_FIELD_TYPE_ID)) {
|
||||||
|
$criteria->add(ProcessVariablesPeer::VAR_FIELD_TYPE_ID, $this->var_field_type_id);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->isColumnModified(ProcessVariablesPeer::VAR_FIELD_SIZE)) {
|
if ($this->isColumnModified(ProcessVariablesPeer::VAR_FIELD_SIZE)) {
|
||||||
$criteria->add(ProcessVariablesPeer::VAR_FIELD_SIZE, $this->var_field_size);
|
$criteria->add(ProcessVariablesPeer::VAR_FIELD_SIZE, $this->var_field_size);
|
||||||
}
|
}
|
||||||
@@ -1078,12 +1246,18 @@ abstract class BaseProcessVariables extends BaseObject implements Persistent
|
|||||||
public function copyInto($copyObj, $deepCopy = false)
|
public function copyInto($copyObj, $deepCopy = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$copyObj->setVarId($this->var_id);
|
||||||
|
|
||||||
$copyObj->setPrjUid($this->prj_uid);
|
$copyObj->setPrjUid($this->prj_uid);
|
||||||
|
|
||||||
|
$copyObj->setProId($this->pro_id);
|
||||||
|
|
||||||
$copyObj->setVarName($this->var_name);
|
$copyObj->setVarName($this->var_name);
|
||||||
|
|
||||||
$copyObj->setVarFieldType($this->var_field_type);
|
$copyObj->setVarFieldType($this->var_field_type);
|
||||||
|
|
||||||
|
$copyObj->setVarFieldTypeId($this->var_field_type_id);
|
||||||
|
|
||||||
$copyObj->setVarFieldSize($this->var_field_size);
|
$copyObj->setVarFieldSize($this->var_field_size);
|
||||||
|
|
||||||
$copyObj->setVarLabel($this->var_label);
|
$copyObj->setVarLabel($this->var_label);
|
||||||
|
|||||||
@@ -25,24 +25,33 @@ abstract class BaseProcessVariablesPeer
|
|||||||
const CLASS_DEFAULT = 'classes.model.ProcessVariables';
|
const CLASS_DEFAULT = 'classes.model.ProcessVariables';
|
||||||
|
|
||||||
/** The total number of columns. */
|
/** The total number of columns. */
|
||||||
const NUM_COLUMNS = 12;
|
const NUM_COLUMNS = 15;
|
||||||
|
|
||||||
/** The number of lazy-loaded columns. */
|
/** The number of lazy-loaded columns. */
|
||||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||||
|
|
||||||
|
|
||||||
|
/** the column name for the VAR_ID field */
|
||||||
|
const VAR_ID = 'PROCESS_VARIABLES.VAR_ID';
|
||||||
|
|
||||||
/** the column name for the VAR_UID field */
|
/** the column name for the VAR_UID field */
|
||||||
const VAR_UID = 'PROCESS_VARIABLES.VAR_UID';
|
const VAR_UID = 'PROCESS_VARIABLES.VAR_UID';
|
||||||
|
|
||||||
/** the column name for the PRJ_UID field */
|
/** the column name for the PRJ_UID field */
|
||||||
const PRJ_UID = 'PROCESS_VARIABLES.PRJ_UID';
|
const PRJ_UID = 'PROCESS_VARIABLES.PRJ_UID';
|
||||||
|
|
||||||
|
/** the column name for the PRO_ID field */
|
||||||
|
const PRO_ID = 'PROCESS_VARIABLES.PRO_ID';
|
||||||
|
|
||||||
/** the column name for the VAR_NAME field */
|
/** the column name for the VAR_NAME field */
|
||||||
const VAR_NAME = 'PROCESS_VARIABLES.VAR_NAME';
|
const VAR_NAME = 'PROCESS_VARIABLES.VAR_NAME';
|
||||||
|
|
||||||
/** the column name for the VAR_FIELD_TYPE field */
|
/** the column name for the VAR_FIELD_TYPE field */
|
||||||
const VAR_FIELD_TYPE = 'PROCESS_VARIABLES.VAR_FIELD_TYPE';
|
const VAR_FIELD_TYPE = 'PROCESS_VARIABLES.VAR_FIELD_TYPE';
|
||||||
|
|
||||||
|
/** the column name for the VAR_FIELD_TYPE_ID field */
|
||||||
|
const VAR_FIELD_TYPE_ID = 'PROCESS_VARIABLES.VAR_FIELD_TYPE_ID';
|
||||||
|
|
||||||
/** the column name for the VAR_FIELD_SIZE field */
|
/** the column name for the VAR_FIELD_SIZE field */
|
||||||
const VAR_FIELD_SIZE = 'PROCESS_VARIABLES.VAR_FIELD_SIZE';
|
const VAR_FIELD_SIZE = 'PROCESS_VARIABLES.VAR_FIELD_SIZE';
|
||||||
|
|
||||||
@@ -78,10 +87,10 @@ abstract class BaseProcessVariablesPeer
|
|||||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||||
*/
|
*/
|
||||||
private static $fieldNames = array (
|
private static $fieldNames = array (
|
||||||
BasePeer::TYPE_PHPNAME => array ('VarUid', 'PrjUid', 'VarName', 'VarFieldType', 'VarFieldSize', 'VarLabel', 'VarDbconnection', 'VarSql', 'VarNull', 'VarDefault', 'VarAcceptedValues', 'InpDocUid', ),
|
BasePeer::TYPE_PHPNAME => array ('VarId', 'VarUid', 'PrjUid', 'ProId', 'VarName', 'VarFieldType', 'VarFieldTypeId', 'VarFieldSize', 'VarLabel', 'VarDbconnection', 'VarSql', 'VarNull', 'VarDefault', 'VarAcceptedValues', 'InpDocUid', ),
|
||||||
BasePeer::TYPE_COLNAME => array (ProcessVariablesPeer::VAR_UID, ProcessVariablesPeer::PRJ_UID, ProcessVariablesPeer::VAR_NAME, ProcessVariablesPeer::VAR_FIELD_TYPE, ProcessVariablesPeer::VAR_FIELD_SIZE, ProcessVariablesPeer::VAR_LABEL, ProcessVariablesPeer::VAR_DBCONNECTION, ProcessVariablesPeer::VAR_SQL, ProcessVariablesPeer::VAR_NULL, ProcessVariablesPeer::VAR_DEFAULT, ProcessVariablesPeer::VAR_ACCEPTED_VALUES, ProcessVariablesPeer::INP_DOC_UID, ),
|
BasePeer::TYPE_COLNAME => array (ProcessVariablesPeer::VAR_ID, ProcessVariablesPeer::VAR_UID, ProcessVariablesPeer::PRJ_UID, ProcessVariablesPeer::PRO_ID, ProcessVariablesPeer::VAR_NAME, ProcessVariablesPeer::VAR_FIELD_TYPE, ProcessVariablesPeer::VAR_FIELD_TYPE_ID, ProcessVariablesPeer::VAR_FIELD_SIZE, ProcessVariablesPeer::VAR_LABEL, ProcessVariablesPeer::VAR_DBCONNECTION, ProcessVariablesPeer::VAR_SQL, ProcessVariablesPeer::VAR_NULL, ProcessVariablesPeer::VAR_DEFAULT, ProcessVariablesPeer::VAR_ACCEPTED_VALUES, ProcessVariablesPeer::INP_DOC_UID, ),
|
||||||
BasePeer::TYPE_FIELDNAME => array ('VAR_UID', 'PRJ_UID', 'VAR_NAME', 'VAR_FIELD_TYPE', 'VAR_FIELD_SIZE', 'VAR_LABEL', 'VAR_DBCONNECTION', 'VAR_SQL', 'VAR_NULL', 'VAR_DEFAULT', 'VAR_ACCEPTED_VALUES', 'INP_DOC_UID', ),
|
BasePeer::TYPE_FIELDNAME => array ('VAR_ID', 'VAR_UID', 'PRJ_UID', 'PRO_ID', 'VAR_NAME', 'VAR_FIELD_TYPE', 'VAR_FIELD_TYPE_ID', 'VAR_FIELD_SIZE', 'VAR_LABEL', 'VAR_DBCONNECTION', 'VAR_SQL', 'VAR_NULL', 'VAR_DEFAULT', 'VAR_ACCEPTED_VALUES', 'INP_DOC_UID', ),
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,10 +100,10 @@ abstract class BaseProcessVariablesPeer
|
|||||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||||
*/
|
*/
|
||||||
private static $fieldKeys = array (
|
private static $fieldKeys = array (
|
||||||
BasePeer::TYPE_PHPNAME => array ('VarUid' => 0, 'PrjUid' => 1, 'VarName' => 2, 'VarFieldType' => 3, 'VarFieldSize' => 4, 'VarLabel' => 5, 'VarDbconnection' => 6, 'VarSql' => 7, 'VarNull' => 8, 'VarDefault' => 9, 'VarAcceptedValues' => 10, 'InpDocUid' => 11, ),
|
BasePeer::TYPE_PHPNAME => array ('VarId' => 0, 'VarUid' => 1, 'PrjUid' => 2, 'ProId' => 3, 'VarName' => 4, 'VarFieldType' => 5, 'VarFieldTypeId' => 6, 'VarFieldSize' => 7, 'VarLabel' => 8, 'VarDbconnection' => 9, 'VarSql' => 10, 'VarNull' => 11, 'VarDefault' => 12, 'VarAcceptedValues' => 13, 'InpDocUid' => 14, ),
|
||||||
BasePeer::TYPE_COLNAME => array (ProcessVariablesPeer::VAR_UID => 0, ProcessVariablesPeer::PRJ_UID => 1, ProcessVariablesPeer::VAR_NAME => 2, ProcessVariablesPeer::VAR_FIELD_TYPE => 3, ProcessVariablesPeer::VAR_FIELD_SIZE => 4, ProcessVariablesPeer::VAR_LABEL => 5, ProcessVariablesPeer::VAR_DBCONNECTION => 6, ProcessVariablesPeer::VAR_SQL => 7, ProcessVariablesPeer::VAR_NULL => 8, ProcessVariablesPeer::VAR_DEFAULT => 9, ProcessVariablesPeer::VAR_ACCEPTED_VALUES => 10, ProcessVariablesPeer::INP_DOC_UID => 11, ),
|
BasePeer::TYPE_COLNAME => array (ProcessVariablesPeer::VAR_ID => 0, ProcessVariablesPeer::VAR_UID => 1, ProcessVariablesPeer::PRJ_UID => 2, ProcessVariablesPeer::PRO_ID => 3, ProcessVariablesPeer::VAR_NAME => 4, ProcessVariablesPeer::VAR_FIELD_TYPE => 5, ProcessVariablesPeer::VAR_FIELD_TYPE_ID => 6, ProcessVariablesPeer::VAR_FIELD_SIZE => 7, ProcessVariablesPeer::VAR_LABEL => 8, ProcessVariablesPeer::VAR_DBCONNECTION => 9, ProcessVariablesPeer::VAR_SQL => 10, ProcessVariablesPeer::VAR_NULL => 11, ProcessVariablesPeer::VAR_DEFAULT => 12, ProcessVariablesPeer::VAR_ACCEPTED_VALUES => 13, ProcessVariablesPeer::INP_DOC_UID => 14, ),
|
||||||
BasePeer::TYPE_FIELDNAME => array ('VAR_UID' => 0, 'PRJ_UID' => 1, 'VAR_NAME' => 2, 'VAR_FIELD_TYPE' => 3, 'VAR_FIELD_SIZE' => 4, 'VAR_LABEL' => 5, 'VAR_DBCONNECTION' => 6, 'VAR_SQL' => 7, 'VAR_NULL' => 8, 'VAR_DEFAULT' => 9, 'VAR_ACCEPTED_VALUES' => 10, 'INP_DOC_UID' => 11, ),
|
BasePeer::TYPE_FIELDNAME => array ('VAR_ID' => 0, 'VAR_UID' => 1, 'PRJ_UID' => 2, 'PRO_ID' => 3, 'VAR_NAME' => 4, 'VAR_FIELD_TYPE' => 5, 'VAR_FIELD_TYPE_ID' => 6, 'VAR_FIELD_SIZE' => 7, 'VAR_LABEL' => 8, 'VAR_DBCONNECTION' => 9, 'VAR_SQL' => 10, 'VAR_NULL' => 11, 'VAR_DEFAULT' => 12, 'VAR_ACCEPTED_VALUES' => 13, 'INP_DOC_UID' => 14, ),
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -195,14 +204,20 @@ abstract class BaseProcessVariablesPeer
|
|||||||
public static function addSelectColumns(Criteria $criteria)
|
public static function addSelectColumns(Criteria $criteria)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(ProcessVariablesPeer::VAR_ID);
|
||||||
|
|
||||||
$criteria->addSelectColumn(ProcessVariablesPeer::VAR_UID);
|
$criteria->addSelectColumn(ProcessVariablesPeer::VAR_UID);
|
||||||
|
|
||||||
$criteria->addSelectColumn(ProcessVariablesPeer::PRJ_UID);
|
$criteria->addSelectColumn(ProcessVariablesPeer::PRJ_UID);
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(ProcessVariablesPeer::PRO_ID);
|
||||||
|
|
||||||
$criteria->addSelectColumn(ProcessVariablesPeer::VAR_NAME);
|
$criteria->addSelectColumn(ProcessVariablesPeer::VAR_NAME);
|
||||||
|
|
||||||
$criteria->addSelectColumn(ProcessVariablesPeer::VAR_FIELD_TYPE);
|
$criteria->addSelectColumn(ProcessVariablesPeer::VAR_FIELD_TYPE);
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(ProcessVariablesPeer::VAR_FIELD_TYPE_ID);
|
||||||
|
|
||||||
$criteria->addSelectColumn(ProcessVariablesPeer::VAR_FIELD_SIZE);
|
$criteria->addSelectColumn(ProcessVariablesPeer::VAR_FIELD_SIZE);
|
||||||
|
|
||||||
$criteria->addSelectColumn(ProcessVariablesPeer::VAR_LABEL);
|
$criteria->addSelectColumn(ProcessVariablesPeer::VAR_LABEL);
|
||||||
|
|||||||
@@ -1974,7 +1974,7 @@
|
|||||||
<index-column name="SES_UID"/>
|
<index-column name="SES_UID"/>
|
||||||
</index>
|
</index>
|
||||||
</table>
|
</table>
|
||||||
<table name="DB_SOURCE">
|
<table name="DB_SOURCE" idMethod="native">
|
||||||
<vendor type="mysql">
|
<vendor type="mysql">
|
||||||
<parameter name="Name" value="DB_SOURCE"/>
|
<parameter name="Name" value="DB_SOURCE"/>
|
||||||
<parameter name="Engine" value="InnoDB"/>
|
<parameter name="Engine" value="InnoDB"/>
|
||||||
@@ -1995,8 +1995,10 @@
|
|||||||
<parameter name="Create_options" value=""/>
|
<parameter name="Create_options" value=""/>
|
||||||
<parameter name="Comment" value="DB_SOURCE"/>
|
<parameter name="Comment" value="DB_SOURCE"/>
|
||||||
</vendor>
|
</vendor>
|
||||||
|
<column name="DBS_ID" type="INTEGER" required="true" autoIncrement="true" unique="true"/>
|
||||||
<column name="DBS_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/>
|
<column name="DBS_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/>
|
||||||
<column name="PRO_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="0"/>
|
<column name="PRO_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="0"/>
|
||||||
|
<column name="PRO_ID" type="INTEGER" required="false" default="0"/>
|
||||||
<column name="DBS_TYPE" type="VARCHAR" size="8" required="true" default="0"/>
|
<column name="DBS_TYPE" type="VARCHAR" size="8" required="true" default="0"/>
|
||||||
<column name="DBS_SERVER" type="VARCHAR" size="100" required="true" default="0"/>
|
<column name="DBS_SERVER" type="VARCHAR" size="100" required="true" default="0"/>
|
||||||
<column name="DBS_DATABASE_NAME" type="VARCHAR" size="100" required="true" default="0"/>
|
<column name="DBS_DATABASE_NAME" type="VARCHAR" size="100" required="true" default="0"/>
|
||||||
@@ -2006,6 +2008,9 @@
|
|||||||
<column name="DBS_ENCODE" type="VARCHAR" size="32" default=""/>
|
<column name="DBS_ENCODE" type="VARCHAR" size="32" default=""/>
|
||||||
<column name="DBS_CONNECTION_TYPE" type="VARCHAR" size="32" default="NORMAL"/>
|
<column name="DBS_CONNECTION_TYPE" type="VARCHAR" size="32" default="NORMAL"/>
|
||||||
<column name="DBS_TNS" type="VARCHAR" size="256" default=""/>
|
<column name="DBS_TNS" type="VARCHAR" size="256" default=""/>
|
||||||
|
<unique name="DBS_ID">
|
||||||
|
<unique-column name="DBS_ID"/>
|
||||||
|
</unique>
|
||||||
<index name="indexDBSource">
|
<index name="indexDBSource">
|
||||||
<index-column name="PRO_UID"/>
|
<index-column name="PRO_UID"/>
|
||||||
<vendor type="mysql">
|
<vendor type="mysql">
|
||||||
@@ -2023,6 +2028,9 @@
|
|||||||
<parameter name="Comment" value=""/>
|
<parameter name="Comment" value=""/>
|
||||||
</vendor>
|
</vendor>
|
||||||
</index>
|
</index>
|
||||||
|
<index name="INDEX_PRO_ID">
|
||||||
|
<index-column name="PRO_ID"/>
|
||||||
|
</index>
|
||||||
</table>
|
</table>
|
||||||
<table name="STEP_SUPERVISOR">
|
<table name="STEP_SUPERVISOR">
|
||||||
<vendor type="mysql">
|
<vendor type="mysql">
|
||||||
@@ -4250,11 +4258,14 @@
|
|||||||
</index>
|
</index>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<table name="PROCESS_VARIABLES">
|
<table name="PROCESS_VARIABLES" idMethod="native">
|
||||||
|
<column name="VAR_ID" type="INTEGER" required="true" autoIncrement="true" unique="true"/>
|
||||||
<column name="VAR_UID" type="VARCHAR" size="32" required="true" primaryKey="true"/>
|
<column name="VAR_UID" type="VARCHAR" size="32" required="true" primaryKey="true"/>
|
||||||
<column name="PRJ_UID" type="VARCHAR" size="32" required="true"/>
|
<column name="PRJ_UID" type="VARCHAR" size="32" required="true"/>
|
||||||
|
<column name="PRO_ID" type="INTEGER" required="false" default="0"/>
|
||||||
<column name="VAR_NAME" type="VARCHAR" size="255" default=""/>
|
<column name="VAR_NAME" type="VARCHAR" size="255" default=""/>
|
||||||
<column name="VAR_FIELD_TYPE" type="VARCHAR" size="32" default=""/>
|
<column name="VAR_FIELD_TYPE" type="VARCHAR" size="32" default=""/>
|
||||||
|
<column name="VAR_FIELD_TYPE_ID" type="INTEGER" default="0"/>
|
||||||
<column name="VAR_FIELD_SIZE" type="INTEGER"/>
|
<column name="VAR_FIELD_SIZE" type="INTEGER"/>
|
||||||
<column name="VAR_LABEL" type="VARCHAR" size="255" default=""/>
|
<column name="VAR_LABEL" type="VARCHAR" size="255" default=""/>
|
||||||
<column name="VAR_DBCONNECTION" type="VARCHAR" size="32"/>
|
<column name="VAR_DBCONNECTION" type="VARCHAR" size="32"/>
|
||||||
@@ -4263,6 +4274,9 @@
|
|||||||
<column name="VAR_DEFAULT" type="VARCHAR" size="32" default=""/>
|
<column name="VAR_DEFAULT" type="VARCHAR" size="32" default=""/>
|
||||||
<column name="VAR_ACCEPTED_VALUES" type="LONGVARCHAR"/>
|
<column name="VAR_ACCEPTED_VALUES" type="LONGVARCHAR"/>
|
||||||
<column name="INP_DOC_UID" type="VARCHAR" size="32" default=""/>
|
<column name="INP_DOC_UID" type="VARCHAR" size="32" default=""/>
|
||||||
|
<unique name="VAR_ID">
|
||||||
|
<unique-column name="VAR_ID"/>
|
||||||
|
</unique>
|
||||||
<index name="indexPrjUidVarName">
|
<index name="indexPrjUidVarName">
|
||||||
<index-column name="PRJ_UID"/>
|
<index-column name="PRJ_UID"/>
|
||||||
<index-column name="VAR_NAME"/>
|
<index-column name="VAR_NAME"/>
|
||||||
@@ -4273,6 +4287,9 @@
|
|||||||
<parameter name="Seq_in_index" value="1"/>
|
<parameter name="Seq_in_index" value="1"/>
|
||||||
</vendor>
|
</vendor>
|
||||||
</index>
|
</index>
|
||||||
|
<index name="INDEX_PRO_ID">
|
||||||
|
<index-column name="PRO_ID"/>
|
||||||
|
</index>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<table name="APP_TIMEOUT_ACTION_EXECUTED">
|
<table name="APP_TIMEOUT_ACTION_EXECUTED">
|
||||||
|
|||||||
@@ -935,8 +935,10 @@ DROP TABLE IF EXISTS `DB_SOURCE`;
|
|||||||
|
|
||||||
CREATE TABLE `DB_SOURCE`
|
CREATE TABLE `DB_SOURCE`
|
||||||
(
|
(
|
||||||
|
`DBS_ID` INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
`DBS_UID` VARCHAR(32) default '' NOT NULL,
|
`DBS_UID` VARCHAR(32) default '' NOT NULL,
|
||||||
`PRO_UID` VARCHAR(32) default '0' NOT NULL,
|
`PRO_UID` VARCHAR(32) default '0' NOT NULL,
|
||||||
|
`PRO_ID` INTEGER default 0,
|
||||||
`DBS_TYPE` VARCHAR(8) default '0' NOT NULL,
|
`DBS_TYPE` VARCHAR(8) default '0' NOT NULL,
|
||||||
`DBS_SERVER` VARCHAR(100) default '0' NOT NULL,
|
`DBS_SERVER` VARCHAR(100) default '0' NOT NULL,
|
||||||
`DBS_DATABASE_NAME` VARCHAR(100) default '0' NOT NULL,
|
`DBS_DATABASE_NAME` VARCHAR(100) default '0' NOT NULL,
|
||||||
@@ -947,7 +949,9 @@ CREATE TABLE `DB_SOURCE`
|
|||||||
`DBS_CONNECTION_TYPE` VARCHAR(32) default 'NORMAL',
|
`DBS_CONNECTION_TYPE` VARCHAR(32) default 'NORMAL',
|
||||||
`DBS_TNS` VARCHAR(256) default '',
|
`DBS_TNS` VARCHAR(256) default '',
|
||||||
PRIMARY KEY (`DBS_UID`,`PRO_UID`),
|
PRIMARY KEY (`DBS_UID`,`PRO_UID`),
|
||||||
KEY `indexDBSource`(`PRO_UID`)
|
UNIQUE KEY `DBS_ID` (`DBS_ID`),
|
||||||
|
KEY `indexDBSource`(`PRO_UID`),
|
||||||
|
KEY `INDEX_PRO_ID`(`PRO_ID`)
|
||||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='DB_SOURCE';
|
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='DB_SOURCE';
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
#-- STEP_SUPERVISOR
|
#-- STEP_SUPERVISOR
|
||||||
@@ -2274,10 +2278,13 @@ DROP TABLE IF EXISTS `PROCESS_VARIABLES`;
|
|||||||
|
|
||||||
CREATE TABLE `PROCESS_VARIABLES`
|
CREATE TABLE `PROCESS_VARIABLES`
|
||||||
(
|
(
|
||||||
|
`VAR_ID` INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
`VAR_UID` VARCHAR(32) NOT NULL,
|
`VAR_UID` VARCHAR(32) NOT NULL,
|
||||||
`PRJ_UID` VARCHAR(32) NOT NULL,
|
`PRJ_UID` VARCHAR(32) NOT NULL,
|
||||||
|
`PRO_ID` INTEGER default 0,
|
||||||
`VAR_NAME` VARCHAR(255) default '',
|
`VAR_NAME` VARCHAR(255) default '',
|
||||||
`VAR_FIELD_TYPE` VARCHAR(32) default '',
|
`VAR_FIELD_TYPE` VARCHAR(32) default '',
|
||||||
|
`VAR_FIELD_TYPE_ID` INTEGER default 0,
|
||||||
`VAR_FIELD_SIZE` INTEGER,
|
`VAR_FIELD_SIZE` INTEGER,
|
||||||
`VAR_LABEL` VARCHAR(255) default '',
|
`VAR_LABEL` VARCHAR(255) default '',
|
||||||
`VAR_DBCONNECTION` VARCHAR(32),
|
`VAR_DBCONNECTION` VARCHAR(32),
|
||||||
@@ -2287,7 +2294,9 @@ CREATE TABLE `PROCESS_VARIABLES`
|
|||||||
`VAR_ACCEPTED_VALUES` MEDIUMTEXT,
|
`VAR_ACCEPTED_VALUES` MEDIUMTEXT,
|
||||||
`INP_DOC_UID` VARCHAR(32) default '',
|
`INP_DOC_UID` VARCHAR(32) default '',
|
||||||
PRIMARY KEY (`VAR_UID`),
|
PRIMARY KEY (`VAR_UID`),
|
||||||
KEY `indexPrjUidVarName`(`PRJ_UID`, `VAR_NAME`)
|
UNIQUE KEY `VAR_ID` (`VAR_ID`),
|
||||||
|
KEY `indexPrjUidVarName`(`PRJ_UID`, `VAR_NAME`),
|
||||||
|
KEY `INDEX_PRO_ID`(`PRO_ID`)
|
||||||
)ENGINE=InnoDB ;
|
)ENGINE=InnoDB ;
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
#-- APP_TIMEOUT_ACTION_EXECUTED
|
#-- APP_TIMEOUT_ACTION_EXECUTED
|
||||||
|
|||||||
@@ -138,26 +138,28 @@ class Validator
|
|||||||
/**
|
/**
|
||||||
* Validate pro_uid
|
* Validate pro_uid
|
||||||
*
|
*
|
||||||
* @param string $pro_uid , Uid for process
|
* @param string $proUid , Uid for process
|
||||||
* @param string $nameField . Name of field for message
|
* @param string $nameField . Name of field for message
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
|
||||||
* @copyright Colosa - Bolivia
|
|
||||||
*
|
*
|
||||||
* @return string
|
* @return int
|
||||||
*/
|
*/
|
||||||
static public function proUid($pro_uid, $nameField = 'pro_uid')
|
static public function proUid($proUid, $nameField = 'pro_uid')
|
||||||
{
|
{
|
||||||
$pro_uid = trim($pro_uid);
|
$proUid = trim($proUid);
|
||||||
if ($pro_uid == '') {
|
if (empty($proUid)) {
|
||||||
throw (new Exception(G::LoadTranslation("ID_PROCESS_NOT_EXIST", array($nameField, ''))));
|
throw (new Exception(G::LoadTranslation("ID_PROCESS_NOT_EXIST", array($nameField, ''))));
|
||||||
}
|
}
|
||||||
$oProcess = new \Process();
|
$process = new \Process();
|
||||||
if (!($oProcess->exists($pro_uid))) {
|
$proId = 0;
|
||||||
throw (new Exception(G::LoadTranslation("ID_PROCESS_NOT_EXIST", array($nameField, $pro_uid))));
|
if (!($process->exists($proUid))) {
|
||||||
|
throw (new Exception(G::LoadTranslation("ID_PROCESS_NOT_EXIST", array($nameField, $proUid))));
|
||||||
|
} else {
|
||||||
|
$proId = $process->load($proUid)['PRO_ID'];
|
||||||
}
|
}
|
||||||
return $pro_uid;
|
|
||||||
|
return $proId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,106 +7,92 @@ use Cases as ClassesCases;
|
|||||||
use Exception;
|
use Exception;
|
||||||
use G;
|
use G;
|
||||||
use PmDynaform;
|
use PmDynaform;
|
||||||
|
use ProcessMaker\Model\ProcessVariables;
|
||||||
|
use ProcessMaker\Util\Common;
|
||||||
|
|
||||||
class Variable
|
class Variable
|
||||||
{
|
{
|
||||||
private $variableTypes = ['string', 'integer', 'float', 'boolean', 'datetime', 'grid', 'array', 'file', 'multiplefile', 'object'];
|
private $variableTypes = ['string', 'integer', 'float', 'boolean', 'datetime', 'grid', 'array', 'file', 'multiplefile', 'object'];
|
||||||
|
public static $varTypesValues = [
|
||||||
|
'string' => 1,
|
||||||
|
'integer' => 2,
|
||||||
|
'float' => 3,
|
||||||
|
'boolean' => 4,
|
||||||
|
'datetime' => 5,
|
||||||
|
'grid' => 6,
|
||||||
|
'array' => 7,
|
||||||
|
'file' => 8,
|
||||||
|
'multiplefile' => 9,
|
||||||
|
'object' => 10
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create Variable for a Process
|
* Create Variable for a Process
|
||||||
*
|
*
|
||||||
* @param string $processUid Unique id of Process
|
* @param string $proUid Unique id of Process
|
||||||
* @param array $arrayData Data
|
* @param array $arrayData Data
|
||||||
*
|
*
|
||||||
* @return array, return data of the new Variable created
|
* @return array, return data of the new Variable created
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function create($processUid, array $arrayData)
|
public function create($proUid, array $arrayData)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
//Verify data
|
$attributes = [];
|
||||||
Validator::proUid($processUid, '$prj_uid');
|
// Verify the process
|
||||||
|
$proId = Validator::proUid($proUid, '$prj_uid');
|
||||||
|
$attributes["PRJ_UID"] = $proUid;
|
||||||
|
$attributes["PRO_ID"] = $proId;
|
||||||
|
// Get the unique varUid
|
||||||
|
$varUid = Common::generateUID();
|
||||||
|
$attributes["VAR_UID"] = $varUid;
|
||||||
|
// Get the attributes
|
||||||
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
|
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
|
||||||
$this->existsName($processUid, $arrayData["VAR_NAME"], "");
|
// Validate properties that cannot be empty
|
||||||
$this->throwExceptionFieldDefinition($arrayData);
|
if (!empty($arrayData["VAR_NAME"])) {
|
||||||
|
$attributes["VAR_NAME"] = $arrayData["VAR_NAME"];
|
||||||
//Create
|
} else {
|
||||||
$cnn = \Propel::getConnection("workflow");
|
throw new Exception(G::LoadTranslation("ID_CAN_NOT_BE_NULL", ['$var_name']));
|
||||||
try {
|
|
||||||
$variable = new \ProcessVariables();
|
|
||||||
$sPkProcessVariables = \ProcessMaker\Util\Common::generateUID();
|
|
||||||
|
|
||||||
$variable->setVarUid($sPkProcessVariables);
|
|
||||||
$variable->setPrjUid($processUid);
|
|
||||||
|
|
||||||
if ($variable->validate()) {
|
|
||||||
$cnn->begin();
|
|
||||||
|
|
||||||
if (isset($arrayData["VAR_NAME"])) {
|
|
||||||
$variable->setVarName($arrayData["VAR_NAME"]);
|
|
||||||
} else {
|
|
||||||
throw new Exception(G::LoadTranslation("ID_CAN_NOT_BE_NULL", array('$var_name')));
|
|
||||||
}
|
|
||||||
if (isset($arrayData["VAR_FIELD_TYPE"])) {
|
|
||||||
$arrayData["VAR_FIELD_TYPE"] = $this->validateVarFieldType($arrayData["VAR_FIELD_TYPE"]);
|
|
||||||
$variable->setVarFieldType($arrayData["VAR_FIELD_TYPE"]);
|
|
||||||
} else {
|
|
||||||
throw new Exception(G::LoadTranslation("ID_CAN_NOT_BE_NULL", array('$var_field_type')));
|
|
||||||
}
|
|
||||||
if (isset($arrayData["VAR_FIELD_SIZE"])) {
|
|
||||||
$variable->setVarFieldSize($arrayData["VAR_FIELD_SIZE"]);
|
|
||||||
}
|
|
||||||
if (isset($arrayData["VAR_LABEL"])) {
|
|
||||||
$variable->setVarLabel($arrayData["VAR_LABEL"]);
|
|
||||||
} else {
|
|
||||||
throw new Exception(G::LoadTranslation("ID_CAN_NOT_BE_NULL", array('$var_label')));
|
|
||||||
}
|
|
||||||
if (isset($arrayData["VAR_DBCONNECTION"])) {
|
|
||||||
$variable->setVarDbconnection($arrayData["VAR_DBCONNECTION"]);
|
|
||||||
} else {
|
|
||||||
$variable->setVarDbconnection("");
|
|
||||||
}
|
|
||||||
if (isset($arrayData["VAR_SQL"])) {
|
|
||||||
$variable->setVarSql($arrayData["VAR_SQL"]);
|
|
||||||
} else {
|
|
||||||
$variable->setVarSql("");
|
|
||||||
}
|
|
||||||
if (isset($arrayData["VAR_NULL"])) {
|
|
||||||
$variable->setVarNull($arrayData["VAR_NULL"]);
|
|
||||||
} else {
|
|
||||||
$variable->setVarNull(0);
|
|
||||||
}
|
|
||||||
if (isset($arrayData["VAR_DEFAULT"])) {
|
|
||||||
$variable->setVarDefault($arrayData["VAR_DEFAULT"]);
|
|
||||||
}
|
|
||||||
if (isset($arrayData["VAR_ACCEPTED_VALUES"])) {
|
|
||||||
$encodeAcceptedValues = G::json_encode($arrayData["VAR_ACCEPTED_VALUES"]);
|
|
||||||
$variable->setVarAcceptedValues($encodeAcceptedValues);
|
|
||||||
}
|
|
||||||
if (isset($arrayData["INP_DOC_UID"])) {
|
|
||||||
$variable->setInpDocUid($arrayData["INP_DOC_UID"]);
|
|
||||||
}
|
|
||||||
$variable->save();
|
|
||||||
$cnn->commit();
|
|
||||||
} else {
|
|
||||||
$msg = "";
|
|
||||||
|
|
||||||
foreach ($variable->getValidationFailures() as $validationFailure) {
|
|
||||||
$msg = $msg . (($msg != "") ? "\n" : "") . $validationFailure->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Exception(G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED") . "\n" . $msg);
|
|
||||||
}
|
|
||||||
} catch (Exception $e) {
|
|
||||||
$cnn->rollback();
|
|
||||||
|
|
||||||
throw $e;
|
|
||||||
}
|
}
|
||||||
|
if (!empty($arrayData["VAR_FIELD_TYPE"])) {
|
||||||
//Return
|
$attributes["VAR_FIELD_TYPE"] = $this->validateVarFieldType($arrayData["VAR_FIELD_TYPE"]);
|
||||||
$variable = $this->getVariable($processUid, $sPkProcessVariables);
|
$attributes["VAR_FIELD_TYPE_ID"] = self::$varTypesValues[$arrayData["VAR_FIELD_TYPE"]];
|
||||||
|
} else {
|
||||||
|
throw new Exception(G::LoadTranslation("ID_CAN_NOT_BE_NULL", ['$var_field_type']));
|
||||||
|
}
|
||||||
|
if (!empty($arrayData["VAR_LABEL"])) {
|
||||||
|
$attributes["VAR_LABEL"] = $arrayData["VAR_LABEL"];
|
||||||
|
} else {
|
||||||
|
throw new Exception(G::LoadTranslation("ID_CAN_NOT_BE_NULL", ['$var_label']));
|
||||||
|
}
|
||||||
|
if (!empty($arrayData["VAR_FIELD_SIZE"])) {
|
||||||
|
$attributes["VAR_FIELD_SIZE"] = $arrayData["VAR_FIELD_SIZE"];
|
||||||
|
}
|
||||||
|
if (!empty($arrayData["VAR_DBCONNECTION"])) {
|
||||||
|
$attributes["VAR_DBCONNECTION"] = $arrayData["VAR_DBCONNECTION"];
|
||||||
|
}
|
||||||
|
if (!empty($arrayData["VAR_SQL"])) {
|
||||||
|
$attributes["VAR_SQL"] = $arrayData["VAR_SQL"];
|
||||||
|
}
|
||||||
|
if (!empty($arrayData["VAR_NULL"])) {
|
||||||
|
$attributes["VAR_NULL"] = $arrayData["VAR_NULL"];
|
||||||
|
}
|
||||||
|
if (!empty($arrayData["VAR_DEFAULT"])) {
|
||||||
|
$attributes["VAR_DEFAULT"] = $arrayData["VAR_DEFAULT"];
|
||||||
|
}
|
||||||
|
if (!empty($arrayData["VAR_ACCEPTED_VALUES"])) {
|
||||||
|
$attributes["VAR_ACCEPTED_VALUES"] = G::json_encode($arrayData["VAR_ACCEPTED_VALUES"]);
|
||||||
|
}
|
||||||
|
if (!empty($arrayData["INP_DOC_UID"])) {
|
||||||
|
$attributes["INP_DOC_UID"] = $arrayData["INP_DOC_UID"];
|
||||||
|
}
|
||||||
|
// Additional validations over the data
|
||||||
|
$this->existsName($proUid, $arrayData["VAR_NAME"], "");
|
||||||
|
$this->throwExceptionFieldDefinition($arrayData);
|
||||||
|
// Register the new variable
|
||||||
|
$processVariables = ProcessVariables::create($attributes);
|
||||||
|
// Return theriable created
|
||||||
|
$variable = $this->getVariable($proUid, $varUid);
|
||||||
return $variable;
|
return $variable;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
@@ -292,7 +278,7 @@ class Variable
|
|||||||
$arrayVariables = array();
|
$arrayVariables = array();
|
||||||
while ($aRow = $rsCriteria->getRow()) {
|
while ($aRow = $rsCriteria->getRow()) {
|
||||||
$VAR_ACCEPTED_VALUES = G::json_decode($aRow['VAR_ACCEPTED_VALUES'], true);
|
$VAR_ACCEPTED_VALUES = G::json_decode($aRow['VAR_ACCEPTED_VALUES'], true);
|
||||||
if (count($VAR_ACCEPTED_VALUES)) {
|
if (!empty($VAR_ACCEPTED_VALUES)) {
|
||||||
$encodeAcceptedValues = preg_replace_callback("/\\\\u([a-f0-9]{4})/", function ($m) {
|
$encodeAcceptedValues = preg_replace_callback("/\\\\u([a-f0-9]{4})/", function ($m) {
|
||||||
return iconv('UCS-4LE', 'UTF-8', pack('V', hexdec('U' . $m[1])));
|
return iconv('UCS-4LE', 'UTF-8', pack('V', hexdec('U' . $m[1])));
|
||||||
}, G::json_encode($VAR_ACCEPTED_VALUES));
|
}, G::json_encode($VAR_ACCEPTED_VALUES));
|
||||||
@@ -333,64 +319,40 @@ class Variable
|
|||||||
*/
|
*/
|
||||||
public function getVariables($processUid)
|
public function getVariables($processUid)
|
||||||
{
|
{
|
||||||
try {
|
//Verify data
|
||||||
//Verify data
|
$proId = Validator::proUid($processUid, '$prj_uid');
|
||||||
Validator::proUid($processUid, '$prj_uid');
|
$variables = ProcessVariables::getVariables($proId);
|
||||||
|
$arrayVariables = [];
|
||||||
//Get data
|
foreach ($variables as $var) {
|
||||||
$criteria = new \Criteria("workflow");
|
$varAcceptedValues = G::json_decode($var['VAR_ACCEPTED_VALUES'], true);
|
||||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_UID);
|
if (count($varAcceptedValues)) {
|
||||||
$criteria->addSelectColumn(\ProcessVariablesPeer::PRJ_UID);
|
$encodeAcceptedValues = preg_replace_callback("/\\\\u([a-f0-9]{4})/", function ($m) {
|
||||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_NAME);
|
return iconv('UCS-4LE', 'UTF-8', pack('V', hexdec($m[1])));
|
||||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_FIELD_TYPE);
|
}, G::json_encode($varAcceptedValues));
|
||||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_FIELD_SIZE);
|
} else {
|
||||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_LABEL);
|
$encodeAcceptedValues = $var['VAR_ACCEPTED_VALUES'];
|
||||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_DBCONNECTION);
|
|
||||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_SQL);
|
|
||||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_NULL);
|
|
||||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_DEFAULT);
|
|
||||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_ACCEPTED_VALUES);
|
|
||||||
$criteria->addSelectColumn(\ProcessVariablesPeer::INP_DOC_UID);
|
|
||||||
$criteria->addSelectColumn(\DbSourcePeer::DBS_SERVER);
|
|
||||||
$criteria->addSelectColumn(\DbSourcePeer::DBS_PORT);
|
|
||||||
$criteria->addSelectColumn(\DbSourcePeer::DBS_DATABASE_NAME);
|
|
||||||
$criteria->addSelectColumn(\DbSourcePeer::DBS_TYPE);
|
|
||||||
$criteria->add(\ProcessVariablesPeer::PRJ_UID, $processUid, \Criteria::EQUAL);
|
|
||||||
$criteria->addJoin(\ProcessVariablesPeer::VAR_DBCONNECTION, \DbSourcePeer::DBS_UID . " AND " . \DbSourcePeer::PRO_UID . " = '" . $processUid . "'", \Criteria::LEFT_JOIN);
|
|
||||||
$rsCriteria = \ProcessVariablesPeer::doSelectRS($criteria);
|
|
||||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
|
||||||
$rsCriteria->next();
|
|
||||||
$arrayVariables = array();
|
|
||||||
while ($aRow = $rsCriteria->getRow()) {
|
|
||||||
$VAR_ACCEPTED_VALUES = G::json_decode($aRow['VAR_ACCEPTED_VALUES'], true);
|
|
||||||
if (count($VAR_ACCEPTED_VALUES)) {
|
|
||||||
$encodeAcceptedValues = preg_replace_callback("/\\\\u([a-f0-9]{4})/", function ($m) {
|
|
||||||
return iconv('UCS-4LE', 'UTF-8', pack('V', hexdec($m[1])));
|
|
||||||
}, G::json_encode($VAR_ACCEPTED_VALUES));
|
|
||||||
} else {
|
|
||||||
$encodeAcceptedValues = $aRow['VAR_ACCEPTED_VALUES'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$arrayVariables[] = array('var_uid' => $aRow['VAR_UID'],
|
|
||||||
'prj_uid' => $aRow['PRJ_UID'],
|
|
||||||
'var_name' => $aRow['VAR_NAME'],
|
|
||||||
'var_field_type' => $aRow['VAR_FIELD_TYPE'],
|
|
||||||
'var_field_size' => (int)$aRow['VAR_FIELD_SIZE'],
|
|
||||||
'var_label' => $aRow['VAR_LABEL'],
|
|
||||||
'var_dbconnection' => $aRow['VAR_DBCONNECTION'] === 'none' ? 'workflow' : $aRow['VAR_DBCONNECTION'],
|
|
||||||
'var_dbconnection_label' => $aRow['DBS_SERVER'] !== null ? '[' . $aRow['DBS_SERVER'] . ':' . $aRow['DBS_PORT'] . '] ' . $aRow['DBS_TYPE'] . ': ' . $aRow['DBS_DATABASE_NAME'] : 'PM Database',
|
|
||||||
'var_sql' => $aRow['VAR_SQL'],
|
|
||||||
'var_null' => (int)$aRow['VAR_NULL'],
|
|
||||||
'var_default' => $aRow['VAR_DEFAULT'],
|
|
||||||
'var_accepted_values' => $encodeAcceptedValues,
|
|
||||||
'inp_doc_uid' => $aRow['INP_DOC_UID']);
|
|
||||||
$rsCriteria->next();
|
|
||||||
}
|
}
|
||||||
//Return
|
$dbconnectionLabel = !is_null($var['DBS_SERVER']) ?
|
||||||
return $arrayVariables;
|
'[' . $var['DBS_SERVER'] . ':' . $var['DBS_PORT'] . '] ' . $var['DBS_TYPE'] . ': ' . $var['DBS_DATABASE_NAME'] : 'PM Database';
|
||||||
} catch (Exception $e) {
|
$arrayVariables[] = [
|
||||||
throw $e;
|
'var_uid' => $var['VAR_UID'],
|
||||||
|
'prj_uid' => $var['PRJ_UID'],
|
||||||
|
'var_name' => $var['VAR_NAME'],
|
||||||
|
'var_field_type' => $var['VAR_FIELD_TYPE'],
|
||||||
|
'var_field_size' => (int)$var['VAR_FIELD_SIZE'],
|
||||||
|
'var_label' => $var['VAR_LABEL'],
|
||||||
|
'var_dbconnection' => $var['VAR_DBCONNECTION'] === 'none' ? 'workflow' : $var['VAR_DBCONNECTION'],
|
||||||
|
'var_dbconnection_label' => !is_null($var['DBS_SERVER']) ?
|
||||||
|
'[' . $var['DBS_SERVER'] . ':' . $var['DBS_PORT'] . '] ' . $var['DBS_TYPE'] . ': ' . $var['DBS_DATABASE_NAME'] : 'PM Database',
|
||||||
|
'var_sql' => $var['VAR_SQL'],
|
||||||
|
'var_null' => (int)$var['VAR_NULL'],
|
||||||
|
'var_default' => $var['VAR_DEFAULT'],
|
||||||
|
'var_accepted_values' => $encodeAcceptedValues,
|
||||||
|
'inp_doc_uid' => $var['INP_DOC_UID']
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $arrayVariables;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace ProcessMaker\Model;
|
namespace ProcessMaker\Model;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class ProcessVariables extends Model
|
class ProcessVariables extends Model
|
||||||
{
|
{
|
||||||
@@ -10,19 +11,89 @@ class ProcessVariables extends Model
|
|||||||
protected $table = 'PROCESS_VARIABLES';
|
protected $table = 'PROCESS_VARIABLES';
|
||||||
// No timestamps
|
// No timestamps
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
//primary key
|
// Primary key
|
||||||
protected $primaryKey = 'VAR_UID';
|
protected $primaryKey = 'VAR_UID';
|
||||||
|
// The IDs are auto-incrementing
|
||||||
public $incrementing = false;
|
public $incrementing = false;
|
||||||
|
/**
|
||||||
|
* The model's default values for attributes.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $attributes = [
|
||||||
|
'VAR_FIELD_SIZE' => 0,
|
||||||
|
'VAR_DBCONNECTION' => '',
|
||||||
|
'VAR_SQL' => '',
|
||||||
|
'VAR_NULL' => 0,
|
||||||
|
'VAR_DEFAULT' => '',
|
||||||
|
'VAR_ACCEPTED_VALUES' => '[]',
|
||||||
|
'INP_DOC_UID' => '',
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* The attributes that are mass assignable.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $fillable = [
|
||||||
|
'VAR_UID',
|
||||||
|
'PRJ_UID',
|
||||||
|
'PRO_ID',
|
||||||
|
'VAR_NAME',
|
||||||
|
'VAR_FIELD_TYPE',
|
||||||
|
'VAR_FIELD_TYPE_ID',
|
||||||
|
'VAR_FIELD_SIZE',
|
||||||
|
'VAR_LABEL',
|
||||||
|
'VAR_DBCONNECTION',
|
||||||
|
'VAR_SQL',
|
||||||
|
'VAR_NULL',
|
||||||
|
'VAR_DEFAULT',
|
||||||
|
'VAR_ACCEPTED_VALUES',
|
||||||
|
'INP_DOC_UID'
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scope a query to filter an specific process
|
* Scope a query to filter an specific process
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||||
* @param string $columns
|
* @param string $proUid
|
||||||
* @return \Illuminate\Database\Eloquent\Builder
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
*/
|
*/
|
||||||
public function scopeProcess($query, string $proUID)
|
public function scopeProcess($query, string $proUid)
|
||||||
{
|
{
|
||||||
return $query->where('PRJ_UID', $proUID);
|
return $query->where('PRJ_UID', $proUid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scope a query to filter an specific process
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||||
|
* @param int $proId
|
||||||
|
* @return \Illuminate\Database\Eloquent\Builder
|
||||||
|
*/
|
||||||
|
public function scopeProcessId($query, int $proId)
|
||||||
|
{
|
||||||
|
return $query->where('PRO_ID', $proId);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Return the variables list
|
||||||
|
*
|
||||||
|
* @param int $proId
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function getVariables(int $proId)
|
||||||
|
{
|
||||||
|
$query = ProcessVariables::query()->select();
|
||||||
|
$query->leftJoin('DB_SOURCE', function ($join) {
|
||||||
|
$join->on('DB_SOURCE.PRO_ID', '=', 'PROCESS_VARIABLES.PRO_ID');
|
||||||
|
});
|
||||||
|
$query->where('PROCESS_VARIABLES.PRO_ID', $proId);
|
||||||
|
$results = $query->get();
|
||||||
|
$variablesList = [];
|
||||||
|
$results->each(function ($item, $key) use (&$variablesList) {
|
||||||
|
$variablesList[] = $item->toArray();
|
||||||
|
});
|
||||||
|
|
||||||
|
return $variablesList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user