Non conflict files

This commit is contained in:
danteloayza
2015-03-26 17:37:32 -04:00
parent c2d32d4f59
commit cff0e2c6e1
69 changed files with 25583 additions and 766 deletions

View File

@@ -0,0 +1,111 @@
<?php
require_once 'classes/model/om/BaseCatalog.php';
/**
* Skeleton subclass for representing a row from the 'CATALOG' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class Catalog extends BaseCatalog
{
public function load ($catUid, $catType)
{
try {
$catalog = CatalogPeer::retrieveByPK($catUid, $catType);
$fields = $catalog->toArray(BasePeer::TYPE_FIELDNAME);
$catalog->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
return $fields;
} catch (Exception $error) {
throw $error;
}
}
public function createOrUpdate($data)
{
$connection = Propel::getConnection(CatalogPeer::DATABASE_NAME);
try {
if (!isset($data['CAT_UID'])) {
$data['CAT_CREATE_DATE'] = date('Y-m-d H:i:s');
$msg = "Create Catalog";
$catalog = new catalog();
} else {
$msg = "Update Catalog";
$catalog = CatalogPeer::retrieveByPK($data['CAT_UID']);
}
$data['CAT_UPDATE_DATE'] = date('Y-m-d H:i:s');
$catalog->fromArray($data, BasePeer::TYPE_FIELDNAME);
if ($catalog->validate()) {
$connection->begin();
$result = $catalog->save();
$connection->commit();
G::auditLog($msg, "Catalog ID Label: ".$catalog->getCatLabelId()." Catalog type: (".$catalog->getCatType().") ");
return $catalog->getCatLabelId();
} else {
$message = '';
$validationFailures = $catalog->getValidationFailures();
foreach ($validationFailures as $validationFailure) {
$message .= $validationFailure->getMessage() . '. ';
}
throw(new Exception(G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED", SYS_LANG) . ' ' . $message));
}
} catch (Exception $error) {
$connection->rollback();
throw $error;
}
}
public function remove($catUid, $catType)
{
$connection = Propel::getConnection(CatalogPeer::DATABASE_NAME);
try {
$catalog = CatalogPeer::retrieveByPK($catUid, $catType);
if (!is_null($catalog)) {
$connection->begin();
$catalogData = $this->load($dasUid);
$result = $catalog->delete();
$connection->commit();
G::auditLog("Deletecatalog", "Catalog Id Label: ". $catalogData['CAT_UID']." Catalog Type: (". $catalogData['CAT_TYPE'] .") ");
return $result;
} else {
throw new Exception('Error trying to delete: The row "' . $catalogData['CAT_UID']. '" does not exist.');
}
} catch (Exception $error) {
$connection->rollback();
throw $error;
}
}
public function loadByType ($catType)
{
try {
$criteria = new Criteria();
$criteria->clearSelectColumns();
$criteria->add(CatalogPeer::CAT_TYPE, strtoupper($catType), Criteria::EQUAL);
$rs = CatalogPeer::doSelectRS($criteria);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$catalog = array();
while ($rs->next()) {
$row = $rs->getRow();
$row['CAT_LABEL_ID'] = G::loadTranslation($row['CAT_LABEL_ID']);
$catalog[] = $row;
}
return $catalog;
} catch (Exception $error) {
throw $error;
}
}
}

View File

@@ -0,0 +1,23 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseCatalogPeer.php';
// include object class
include_once 'classes/model/Catalog.php';
/**
* Skeleton subclass for performing query and update operations on the 'CATALOG' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class CatalogPeer extends BaseCatalogPeer {
} // CatalogPeer

View File

@@ -0,0 +1,103 @@
<?php
require_once 'classes/model/om/BaseDashboard.php';
/**
* Skeleton subclass for representing a row from the 'DASHBOARD' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class Dashboard extends BaseDashboard
{
public function load ($dasUid)
{
try {
$dashboard = DashboardPeer::retrieveByPK($dasUid);
$fields = $dashboard->toArray(BasePeer::TYPE_FIELDNAME);
$dashboard->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
return $fields;
} catch (Exception $error) {
throw $error;
}
}
public function createOrUpdate($data)
{
$connection = Propel::getConnection(DashboardPeer::DATABASE_NAME);
try {
if (!isset($data['DAS_UID'])) {
$data['DAS_UID'] = G::generateUniqueID();
$data['DAS_CREATE_DATE'] = date('Y-m-d H:i:s');
$dashboard = new Dashboard();
$msg = 'Create ';
} else {
$msg = 'Update ';
$dashboard = DashboardPeer::retrieveByPK($data['DAS_UID']);
}
$data['DAS_UPDATE_DATE'] = date('Y-m-d H:i:s');
$dashboard->fromArray($data, BasePeer::TYPE_FIELDNAME);
if ($dashboard->validate()) {
$connection->begin();
$result = $dashboard->save();
$connection->commit();
G::auditLog($msg, "Dashboard Name: " . $dashboard->getDasTitle() . " Dashboard ID: (".$dashboard->getDasUid().") ");
return $dashboard->getDasUid();
} else {
$message = '';
$validationFailures = $dashboard->getValidationFailures();
foreach ($validationFailures as $validationFailure) {
$message .= $validationFailure->getMessage() . '. ';
}
throw(new Exception(G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED", SYS_LANG) . ' ' . $message));
}
} catch (Exception $error) {
$connection->rollback();
throw $error;
}
}
public function remove($dasUid)
{
$connection = Propel::getConnection(DashboardPeer::DATABASE_NAME);
try {
require_once 'classes/model/DashboardDasInd.php';
$criteria = new Criteria('workflow');
$criteria->add(DashboardDasIndPeer::DAS_UID, $dasUid);
DashboardDasIndPeer::doDelete($criteria);
require_once 'classes/model/DashboardIndicator.php';
$criteria = new Criteria('workflow');
$criteria->add(DashboardIndicatorPeer::DAS_UID, $dasUid);
DashboardIndicatorPeer::doDelete($criteria);
$dashboard = DashboardPeer::retrieveByPK($dasUid);
if (!is_null($dashboard)) {
$connection->begin();
$dashboardData = $this->load($dasUid);
$result = $dashboard->delete();
$connection->commit();
G::auditLog("Deletedashboard", "Dashboard Name: ". $dashboardData['DAS_TITLE']." Dashboard ID: (".$dasUid.") ");
return $result;
} else {
throw new Exception('Error trying to delete: The row "' . $dasUid. '" does not exist.');
}
} catch (Exception $error) {
$connection->rollback();
throw $error;
}
}
}

View File

@@ -0,0 +1,117 @@
<?php
require_once 'classes/model/om/BaseDashboardDasInd.php';
/**
* Skeleton subclass for representing a row from the 'DASHBOARD_DAS_IND' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class DashboardDasInd extends BaseDashboardDasInd
{
public function loadByDashboards ($dasUid)
{
try {
$criteria = new Criteria('workflow');
$criteria->add(DashboardDasIndPeer::DAS_UID, $dasUid);
$dataset = DashboardDasIndPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$fields = array();
while ($dataset->next()) {
$auxField = $dataset->getRow();
$fields[] = $auxField;
}
return $fields;
} catch (Exception $error) {
throw $error;
}
}
public function loadByOwner ($ownerUid)
{
try {
$criteria = new Criteria('workflow');
$criteria->add(DashboardDasIndPeer::OWNER_UID, $ownerUid);
$dataset = DashboardDasIndPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$fields = array();
while ($dataset->next()) {
$auxField = $dataset->getRow();
$fields[] = $auxField;
}
return $fields;
} catch (Exception $error) {
throw $error;
}
}
public function create($data)
{
$connection = Propel::getConnection(DashboardDasIndPeer::DATABASE_NAME);
try {
$dashboardDasInd = new DashboardDasInd();
$dashboardDasInd->fromArray($data, BasePeer::TYPE_FIELDNAME);
if ($dashboardDasInd->validate()) {
$connection->begin();
$result = $dashboardDasInd->save();
$connection->commit();
G::auditLog("Create", "Dashboard Owner: ". $data['OWNER_UID']." Dashboard ID: (".$dashboardDasInd->getDasUid().") ");
return $dashboardDasInd;
} else {
$message = '';
$validationFailures = $dashboardDasInd->getValidationFailures();
foreach ($validationFailures as $validationFailure) {
$message .= $validationFailure->getMessage() . '. ';
}
throw(new Exception(G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED", SYS_LANG) . ' ' . $message));
}
} catch (Exception $error) {
$connection->rollback();
throw $error;
}
}
public function remove($dasUid, $owner)
{
$connection = Propel::getConnection(DashboardDasIndPeer::DATABASE_NAME);
try {
$dashboardDasInd = DashboardDasIndPeer::retrieveByPK($dasUid, $owner);
if (!is_null($dashboardDasInd)) {
$connection->begin();
$result = $dashboardDasInd->delete();
$connection->commit();
G::auditLog("DeletedashboardIndicator", "Dashboard ID: ". $dasUid ." Dashboard owner ID: (".$owner.") ");
return $result;
} else {
throw new Exception('Error trying to delete: The row "' . $dasUid. '" does not exist.');
}
} catch (Exception $error) {
$connection->rollback();
throw $error;
}
}
public function getOwnerByDashboard ($dasUid)
{
}
}

View File

@@ -0,0 +1,23 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseDashboardDasIndPeer.php';
// include object class
include_once 'classes/model/DashboardDasInd.php';
/**
* Skeleton subclass for performing query and update operations on the 'DASHBOARD_DAS_IND' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class DashboardDasIndPeer extends BaseDashboardDasIndPeer {
} // DashboardDasIndPeer

View File

@@ -0,0 +1,169 @@
<?php
require_once 'classes/model/om/BaseDashboardIndicator.php';
/**
* Skeleton subclass for representing a row from the 'DASHBOARD_INDICATOR' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class DashboardIndicator extends BaseDashboardIndicator
{
public function load ($dasIndUid)
{
try {
$dashboardIndicator = DashboardIndicatorPeer::retrieveByPK($dasIndUid);
$fields = $dashboardIndicator->toArray(BasePeer::TYPE_FIELDNAME);
$dashboardIndicator->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
return $fields;
} catch (Exception $error) {
throw $error;
}
}
function loadbyDasUid ($dasUid, $vmeasureDate, $vcompareDate, $userUid)
{
G::loadClass('indicatorsCalculator');
$calculator = new \IndicatorsCalculator();
try {
$connection = Propel::getConnection('workflow');
$qryString = "select * from CONFIGURATION where CFG_UID = 'DASHBOARDS_SETTINGS' and USR_UID = '$userUid'";
$qry = $connection->PrepareStatement($qryString);
$dataSet = $qry->executeQuery();
$dashConfig = array();
while ($dataSet->next()){
$row = $dataSet->getRow();
$dashConfig = unserialize($row['CFG_VALUE']);
}
$criteria = new Criteria( 'workflow' );
$criteria->clearSelectColumns()->clearOrderByColumns();
$criteria->add( DashboardIndicatorPeer::DAS_UID, $dasUid, criteria::EQUAL );
$rs = DashboardIndicatorPeer::doSelectRS( $criteria );
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$dashboardIndicator = array();
while ($rs->next()) {
$row = $rs->getRow();
//$currentDate = new DateTime (date("Y-m-d"));
$measureDate = new DateTime ($vmeasureDate);
$compareDate = new DateTime ($vcompareDate);
$uid = ($row['DAS_UID_PROCESS'] == '0' ? null: $row['DAS_UID_PROCESS']) ;
switch ($row['DAS_IND_TYPE']) {
case '1010':
$value = current(reset($calculator->peiHistoric($uid, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE)));
$oldValue = current(reset($calculator->peiHistoric($uid, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE)));
$row['DAS_IND_VARIATION'] = $value - $oldValue;
break;
case '1030':
$value = current(reset($calculator->ueiHistoric(null, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE)));
$oldValue = current(reset($calculator->ueiHistoric($uid, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE)));
$row['DAS_IND_VARIATION'] = $value - $oldValue;
break;
default:
$arrResult = $calculator->generalIndicatorData($row['DAS_IND_UID'], $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE);
$value = $arrResult[0]['value'];
$row['DAS_IND_VARIATION'] = $row['DAS_IND_GOAL'];
break;
}
$row['DAS_IND_VALUE'] = $value;
$indId = $row['DAS_IND_UID'];
$row['DAS_IND_X'] = 0;
$row['DAS_IND_Y'] = 0;
$row['DAS_IND_WIDTH'] = 0;
$row['DAS_IND_HEIGHT'] = 0;
$row['DAS_IND_FAVORITE'] = 0;
foreach ($dashConfig as $dashId=>$oneDash) {
if($dashId == $dasUid && is_array($oneDash['dashData'])) {
foreach($oneDash['dashData'] as $graphConfig) {
if ($graphConfig['indicatorId'] == $indId) {
$row['DAS_IND_X'] = $graphConfig['x'];
$row['DAS_IND_Y'] = $graphConfig['y'];
$row['DAS_IND_WIDTH'] = $graphConfig['width'];
$row['DAS_IND_HEIGHT'] = $graphConfig['height'];
}
}
}
}
$dashboardIndicator[] = $row;
}
return $dashboardIndicator;
} catch (Exception $error) {
throw $error;
}
}
public function createOrUpdate($data)
{
$connection = Propel::getConnection(DashboardIndicatorPeer::DATABASE_NAME);
try {
if (!isset($data['DAS_IND_UID'])) {
$data['DAS_IND_UID'] = G::generateUniqueID();
$data['DAS_IND_CREATE_DATE'] = date('Y-m-d H:i:s');
$dashboardIndicator = new DashboardIndicator();
$msg = 'Create';
} else {
$msg = 'Update';
$dashboardIndicator = DashboardIndicatorPeer::retrieveByPK($data['DAS_IND_UID']);
}
$data['DAS_IND_UPDATE_DATE'] = date('Y-m-d H:i:s');
$dashboardIndicator->fromArray($data, BasePeer::TYPE_FIELDNAME);
if ($dashboardIndicator->validate()) {
$connection->begin();
$result = $dashboardIndicator->save();
$connection->commit();
G::auditLog($msg, "Dashboard Indicator Name: ".$dashboardIndicator->getDasIndTitle()." Dashboard indicator ID: (".$dashboardIndicator->getDasIndUid() .") ");
return $dashboardIndicator->getDasIndUid();
} else {
$message = '';
$validationFailures = $dashboardIndicator->getValidationFailures();
foreach ($validationFailures as $validationFailure) {
$message .= $validationFailure->getMessage() . '. ';
}
throw(new Exception(G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED", SYS_LANG) . ' ' . $message));
}
} catch (Exception $error) {
$connection->rollback();
throw $error;
}
}
public function remove($dasIndUid)
{
$connection = Propel::getConnection(DashboardIndicatorPeer::DATABASE_NAME);
try {
$dashboardIndicator = DashboardIndicatorPeer::retrieveByPK($dasIndUid);
if (!is_null($dashboardIndicator)) {
$connection->begin();
$dashboardIndicatorData = $this->load($dasIndUid);
$result = $dashboardIndicator->delete();
$connection->commit();
G::auditLog("DeletedashboardIndicator", "Dashboard Indicator Name: ". $dashboardIndicatorData['DAS_IND_TITLE']." Dashboard Instance ID: (".$dasIndUid.") ");
return $result;
} else {
throw new Exception('Error trying to delete: The row "' . $dasIndUid. '" does not exist.');
}
} catch (Exception $error) {
$connection->rollback();
throw $error;
}
}
}

View File

@@ -0,0 +1,23 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseDashboardIndicatorPeer.php';
// include object class
include_once 'classes/model/DashboardIndicator.php';
/**
* Skeleton subclass for performing query and update operations on the 'DASHBOARD_INDICATOR' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class DashboardIndicatorPeer extends BaseDashboardIndicatorPeer {
} // DashboardIndicatorPeer

View File

@@ -0,0 +1,23 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseDashboardPeer.php';
// include object class
include_once 'classes/model/Dashboard.php';
/**
* Skeleton subclass for performing query and update operations on the 'DASHBOARD' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class DashboardPeer extends BaseDashboardPeer {
} // DashboardPeer

View File

@@ -0,0 +1,19 @@
<?php
require_once 'classes/model/om/BaseProReporting.php';
/**
* Skeleton subclass for representing a row from the 'PRO_REPORTING' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class ProReporting extends BaseProReporting {
} // ProReporting

View File

@@ -0,0 +1,23 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseProReportingPeer.php';
// include object class
include_once 'classes/model/ProReporting.php';
/**
* Skeleton subclass for performing query and update operations on the 'PRO_REPORTING' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class ProReportingPeer extends BaseProReportingPeer {
} // ProReportingPeer

View File

@@ -0,0 +1,19 @@
<?php
require_once 'classes/model/om/BaseUsrReporting.php';
/**
* Skeleton subclass for representing a row from the 'USR_REPORTING' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class UsrReporting extends BaseUsrReporting {
} // UsrReporting

View File

@@ -0,0 +1,23 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseUsrReportingPeer.php';
// include object class
include_once 'classes/model/UsrReporting.php';
/**
* Skeleton subclass for performing query and update operations on the 'USR_REPORTING' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class UsrReportingPeer extends BaseUsrReportingPeer {
} // UsrReportingPeer

View File

@@ -0,0 +1,84 @@
<?php
require_once 'propel/map/MapBuilder.php';
include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'CATALOG' table to 'workflow' DatabaseMap object.
*
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package workflow.classes.model.map
*/
class CatalogMapBuilder
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.CatalogMapBuilder';
/**
* The database map.
*/
private $dbMap;
/**
* Tells us if this DatabaseMapBuilder is built so that we
* don't have to re-build it every time.
*
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
*/
public function isBuilt()
{
return ($this->dbMap !== null);
}
/**
* Gets the databasemap this map builder built.
*
* @return the databasemap
*/
public function getDatabaseMap()
{
return $this->dbMap;
}
/**
* The doBuild() method builds the DatabaseMap
*
* @return void
* @throws PropelException
*/
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('workflow');
$tMap = $this->dbMap->addTable('CATALOG');
$tMap->setPhpName('Catalog');
$tMap->setUseIdGenerator(false);
$tMap->addPrimaryKey('CAT_UID', 'CatUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('CAT_LABEL_ID', 'CatLabelId', 'string', CreoleTypes::VARCHAR, true, 100);
$tMap->addPrimaryKey('CAT_TYPE', 'CatType', 'string', CreoleTypes::VARCHAR, true, 100);
$tMap->addColumn('CAT_FLAG', 'CatFlag', 'string', CreoleTypes::VARCHAR, false, 50);
$tMap->addColumn('CAT_OBSERVATION', 'CatObservation', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('CAT_CREATE_DATE', 'CatCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
$tMap->addColumn('CAT_UPDATE_DATE', 'CatUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
} // doBuild()
} // CatalogMapBuilder

View File

@@ -0,0 +1,76 @@
<?php
require_once 'propel/map/MapBuilder.php';
include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'DASHBOARD_DAS_IND' table to 'workflow' DatabaseMap object.
*
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package workflow.classes.model.map
*/
class DashboardDasIndMapBuilder
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.DashboardDasIndMapBuilder';
/**
* The database map.
*/
private $dbMap;
/**
* Tells us if this DatabaseMapBuilder is built so that we
* don't have to re-build it every time.
*
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
*/
public function isBuilt()
{
return ($this->dbMap !== null);
}
/**
* Gets the databasemap this map builder built.
*
* @return the databasemap
*/
public function getDatabaseMap()
{
return $this->dbMap;
}
/**
* The doBuild() method builds the DatabaseMap
*
* @return void
* @throws PropelException
*/
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('workflow');
$tMap = $this->dbMap->addTable('DASHBOARD_DAS_IND');
$tMap->setPhpName('DashboardDasInd');
$tMap->setUseIdGenerator(false);
$tMap->addForeignPrimaryKey('DAS_UID', 'DasUid', 'string' , CreoleTypes::VARCHAR, 'DASHBOARD', 'DAS_UID', true, 32);
$tMap->addPrimaryKey('OWNER_UID', 'OwnerUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('OWNER_TYPE', 'OwnerType', 'string', CreoleTypes::VARCHAR, true, 15);
} // doBuild()
} // DashboardDasIndMapBuilder

View File

@@ -0,0 +1,98 @@
<?php
require_once 'propel/map/MapBuilder.php';
include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'DASHBOARD_INDICATOR' table to 'workflow' DatabaseMap object.
*
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package workflow.classes.model.map
*/
class DashboardIndicatorMapBuilder
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.DashboardIndicatorMapBuilder';
/**
* The database map.
*/
private $dbMap;
/**
* Tells us if this DatabaseMapBuilder is built so that we
* don't have to re-build it every time.
*
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
*/
public function isBuilt()
{
return ($this->dbMap !== null);
}
/**
* Gets the databasemap this map builder built.
*
* @return the databasemap
*/
public function getDatabaseMap()
{
return $this->dbMap;
}
/**
* The doBuild() method builds the DatabaseMap
*
* @return void
* @throws PropelException
*/
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('workflow');
$tMap = $this->dbMap->addTable('DASHBOARD_INDICATOR');
$tMap->setPhpName('DashboardIndicator');
$tMap->setUseIdGenerator(false);
$tMap->addPrimaryKey('DAS_IND_UID', 'DasIndUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addForeignKey('DAS_UID', 'DasUid', 'string', CreoleTypes::VARCHAR, 'DASHBOARD', 'DAS_UID', true, 32);
$tMap->addColumn('DAS_IND_TYPE', 'DasIndType', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('DAS_IND_TITLE', 'DasIndTitle', 'string', CreoleTypes::VARCHAR, true, 255);
$tMap->addColumn('DAS_IND_GOAL', 'DasIndGoal', 'double', CreoleTypes::DECIMAL, true, 7,2);
$tMap->addColumn('DAS_IND_DIRECTION', 'DasIndDirection', 'int', CreoleTypes::TINYINT, true, null);
$tMap->addColumn('DAS_UID_PROCESS', 'DasUidProcess', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('DAS_IND_FIRST_FIGURE', 'DasIndFirstFigure', 'string', CreoleTypes::VARCHAR, false, 32);
$tMap->addColumn('DAS_IND_FIRST_FREQUENCY', 'DasIndFirstFrequency', 'string', CreoleTypes::VARCHAR, false, 32);
$tMap->addColumn('DAS_IND_SECOND_FIGURE', 'DasIndSecondFigure', 'string', CreoleTypes::VARCHAR, false, 32);
$tMap->addColumn('DAS_IND_SECOND_FREQUENCY', 'DasIndSecondFrequency', 'string', CreoleTypes::VARCHAR, false, 32);
$tMap->addColumn('DAS_IND_CREATE_DATE', 'DasIndCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
$tMap->addColumn('DAS_IND_UPDATE_DATE', 'DasIndUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
$tMap->addColumn('DAS_IND_STATUS', 'DasIndStatus', 'int', CreoleTypes::TINYINT, true, null);
} // doBuild()
} // DashboardIndicatorMapBuilder

View File

@@ -0,0 +1,82 @@
<?php
require_once 'propel/map/MapBuilder.php';
include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'DASHBOARD' table to 'workflow' DatabaseMap object.
*
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package workflow.classes.model.map
*/
class DashboardMapBuilder
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.DashboardMapBuilder';
/**
* The database map.
*/
private $dbMap;
/**
* Tells us if this DatabaseMapBuilder is built so that we
* don't have to re-build it every time.
*
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
*/
public function isBuilt()
{
return ($this->dbMap !== null);
}
/**
* Gets the databasemap this map builder built.
*
* @return the databasemap
*/
public function getDatabaseMap()
{
return $this->dbMap;
}
/**
* The doBuild() method builds the DatabaseMap
*
* @return void
* @throws PropelException
*/
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('workflow');
$tMap = $this->dbMap->addTable('DASHBOARD');
$tMap->setPhpName('Dashboard');
$tMap->setUseIdGenerator(false);
$tMap->addPrimaryKey('DAS_UID', 'DasUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('DAS_TITLE', 'DasTitle', 'string', CreoleTypes::VARCHAR, true, 255);
$tMap->addColumn('DAS_DESCRIPTION', 'DasDescription', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('DAS_CREATE_DATE', 'DasCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
$tMap->addColumn('DAS_UPDATE_DATE', 'DasUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
$tMap->addColumn('DAS_STATUS', 'DasStatus', 'int', CreoleTypes::TINYINT, true, null);
} // doBuild()
} // DashboardMapBuilder

View File

@@ -0,0 +1,94 @@
<?php
require_once 'propel/map/MapBuilder.php';
include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'PRO_REPORTING' table to 'workflow' DatabaseMap object.
*
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package workflow.classes.model.map
*/
class ProReportingMapBuilder
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.ProReportingMapBuilder';
/**
* The database map.
*/
private $dbMap;
/**
* Tells us if this DatabaseMapBuilder is built so that we
* don't have to re-build it every time.
*
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
*/
public function isBuilt()
{
return ($this->dbMap !== null);
}
/**
* Gets the databasemap this map builder built.
*
* @return the databasemap
*/
public function getDatabaseMap()
{
return $this->dbMap;
}
/**
* The doBuild() method builds the DatabaseMap
*
* @return void
* @throws PropelException
*/
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('workflow');
$tMap = $this->dbMap->addTable('PRO_REPORTING');
$tMap->setPhpName('ProReporting');
$tMap->setUseIdGenerator(false);
$tMap->addPrimaryKey('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addPrimaryKey('MONTH', 'Month', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addPrimaryKey('YEAR', 'Year', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('AVG_TIME', 'AvgTime', 'double', CreoleTypes::DECIMAL, false, 7,2);
$tMap->addColumn('SDV_TIME', 'SdvTime', 'double', CreoleTypes::DECIMAL, false, 7,2);
$tMap->addColumn('TOTAL_CASES_IN', 'TotalCasesIn', 'double', CreoleTypes::DECIMAL, false, 7,2);
$tMap->addColumn('TOTAL_CASES_OUT', 'TotalCasesOut', 'double', CreoleTypes::DECIMAL, false, 7,2);
$tMap->addColumn('CONFIGURED_PROCESS_TIME', 'ConfiguredProcessTime', 'double', CreoleTypes::DECIMAL, false, 7,2);
$tMap->addColumn('CONFIGURED_PROCESS_COST', 'ConfiguredProcessCost', 'double', CreoleTypes::DECIMAL, false, 7,2);
$tMap->addColumn('TOTAL_CASES_OPEN', 'TotalCasesOpen', 'double', CreoleTypes::DECIMAL, false, 7,2);
$tMap->addColumn('TOTAL_CASES_OVERDUE', 'TotalCasesOverdue', 'double', CreoleTypes::DECIMAL, false, 7,2);
$tMap->addColumn('TOTAL_CASES_ON_TIME', 'TotalCasesOnTime', 'double', CreoleTypes::DECIMAL, false, 7,2);
} // doBuild()
} // ProReportingMapBuilder

View File

@@ -0,0 +1,98 @@
<?php
require_once 'propel/map/MapBuilder.php';
include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'USR_REPORTING' table to 'workflow' DatabaseMap object.
*
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package workflow.classes.model.map
*/
class UsrReportingMapBuilder
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.UsrReportingMapBuilder';
/**
* The database map.
*/
private $dbMap;
/**
* Tells us if this DatabaseMapBuilder is built so that we
* don't have to re-build it every time.
*
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
*/
public function isBuilt()
{
return ($this->dbMap !== null);
}
/**
* Gets the databasemap this map builder built.
*
* @return the databasemap
*/
public function getDatabaseMap()
{
return $this->dbMap;
}
/**
* The doBuild() method builds the DatabaseMap
*
* @return void
* @throws PropelException
*/
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('workflow');
$tMap = $this->dbMap->addTable('USR_REPORTING');
$tMap->setPhpName('UsrReporting');
$tMap->setUseIdGenerator(false);
$tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addPrimaryKey('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addPrimaryKey('MONTH', 'Month', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addPrimaryKey('YEAR', 'Year', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('TOTAL_TIME_BY_TASK', 'TotalTimeByTask', 'double', CreoleTypes::DECIMAL, false, 7,2);
$tMap->addColumn('TOTAL_CASES_IN', 'TotalCasesIn', 'double', CreoleTypes::DECIMAL, false, 7,2);
$tMap->addColumn('TOTAL_CASES_OUT', 'TotalCasesOut', 'double', CreoleTypes::DECIMAL, false, 7,2);
$tMap->addColumn('USER_HOUR_COST', 'UserHourCost', 'double', CreoleTypes::DECIMAL, false, 7,2);
$tMap->addColumn('AVG_TIME', 'AvgTime', 'double', CreoleTypes::DECIMAL, false, 7,2);
$tMap->addColumn('SDV_TIME', 'SdvTime', 'double', CreoleTypes::DECIMAL, false, 7,2);
$tMap->addColumn('CONFIGURED_TASK_TIME', 'ConfiguredTaskTime', 'double', CreoleTypes::DECIMAL, false, 7,2);
$tMap->addColumn('TOTAL_CASES_OVERDUE', 'TotalCasesOverdue', 'double', CreoleTypes::DECIMAL, false, 7,2);
$tMap->addColumn('TOTAL_CASES_ON_TIME', 'TotalCasesOnTime', 'double', CreoleTypes::DECIMAL, false, 7,2);
} // doBuild()
} // UsrReportingMapBuilder

View File

@@ -0,0 +1,926 @@
<?php
require_once 'propel/om/BaseObject.php';
require_once 'propel/om/Persistent.php';
include_once 'propel/util/Criteria.php';
include_once 'classes/model/CatalogPeer.php';
/**
* Base class that represents a row from the 'CATALOG' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BaseCatalog extends BaseObject implements Persistent
{
/**
* The Peer class.
* Instance provides a convenient way of calling static methods on a class
* that calling code may not be able to identify.
* @var CatalogPeer
*/
protected static $peer;
/**
* The value for the cat_uid field.
* @var string
*/
protected $cat_uid = '0';
/**
* The value for the cat_label_id field.
* @var string
*/
protected $cat_label_id = '';
/**
* The value for the cat_type field.
* @var string
*/
protected $cat_type = '';
/**
* The value for the cat_flag field.
* @var string
*/
protected $cat_flag = '';
/**
* The value for the cat_observation field.
* @var string
*/
protected $cat_observation = '';
/**
* The value for the cat_create_date field.
* @var int
*/
protected $cat_create_date;
/**
* The value for the cat_update_date field.
* @var int
*/
protected $cat_update_date;
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
* @var boolean
*/
protected $alreadyInSave = false;
/**
* Flag to prevent endless validation loop, if this object is referenced
* by another object which falls in this transaction.
* @var boolean
*/
protected $alreadyInValidation = false;
/**
* Get the [cat_uid] column value.
*
* @return string
*/
public function getCatUid()
{
return $this->cat_uid;
}
/**
* Get the [cat_label_id] column value.
*
* @return string
*/
public function getCatLabelId()
{
return $this->cat_label_id;
}
/**
* Get the [cat_type] column value.
*
* @return string
*/
public function getCatType()
{
return $this->cat_type;
}
/**
* Get the [cat_flag] column value.
*
* @return string
*/
public function getCatFlag()
{
return $this->cat_flag;
}
/**
* Get the [cat_observation] column value.
*
* @return string
*/
public function getCatObservation()
{
return $this->cat_observation;
}
/**
* Get the [optionally formatted] [cat_create_date] column value.
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the integer unix timestamp will be returned.
* @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
* @throws PropelException - if unable to convert the date/time to timestamp.
*/
public function getCatCreateDate($format = 'Y-m-d H:i:s')
{
if ($this->cat_create_date === null || $this->cat_create_date === '') {
return null;
} elseif (!is_int($this->cat_create_date)) {
// a non-timestamp value was set externally, so we convert it
$ts = strtotime($this->cat_create_date);
if ($ts === -1 || $ts === false) {
throw new PropelException("Unable to parse value of [cat_create_date] as date/time value: " .
var_export($this->cat_create_date, true));
}
} else {
$ts = $this->cat_create_date;
}
if ($format === null) {
return $ts;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $ts);
} else {
return date($format, $ts);
}
}
/**
* Get the [optionally formatted] [cat_update_date] column value.
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the integer unix timestamp will be returned.
* @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
* @throws PropelException - if unable to convert the date/time to timestamp.
*/
public function getCatUpdateDate($format = 'Y-m-d H:i:s')
{
if ($this->cat_update_date === null || $this->cat_update_date === '') {
return null;
} elseif (!is_int($this->cat_update_date)) {
// a non-timestamp value was set externally, so we convert it
$ts = strtotime($this->cat_update_date);
if ($ts === -1 || $ts === false) {
throw new PropelException("Unable to parse value of [cat_update_date] as date/time value: " .
var_export($this->cat_update_date, true));
}
} else {
$ts = $this->cat_update_date;
}
if ($format === null) {
return $ts;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $ts);
} else {
return date($format, $ts);
}
}
/**
* Set the value of [cat_uid] column.
*
* @param string $v new value
* @return void
*/
public function setCatUid($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->cat_uid !== $v || $v === '0') {
$this->cat_uid = $v;
$this->modifiedColumns[] = CatalogPeer::CAT_UID;
}
} // setCatUid()
/**
* Set the value of [cat_label_id] column.
*
* @param string $v new value
* @return void
*/
public function setCatLabelId($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->cat_label_id !== $v || $v === '') {
$this->cat_label_id = $v;
$this->modifiedColumns[] = CatalogPeer::CAT_LABEL_ID;
}
} // setCatLabelId()
/**
* Set the value of [cat_type] column.
*
* @param string $v new value
* @return void
*/
public function setCatType($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->cat_type !== $v || $v === '') {
$this->cat_type = $v;
$this->modifiedColumns[] = CatalogPeer::CAT_TYPE;
}
} // setCatType()
/**
* Set the value of [cat_flag] column.
*
* @param string $v new value
* @return void
*/
public function setCatFlag($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->cat_flag !== $v || $v === '') {
$this->cat_flag = $v;
$this->modifiedColumns[] = CatalogPeer::CAT_FLAG;
}
} // setCatFlag()
/**
* Set the value of [cat_observation] column.
*
* @param string $v new value
* @return void
*/
public function setCatObservation($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->cat_observation !== $v || $v === '') {
$this->cat_observation = $v;
$this->modifiedColumns[] = CatalogPeer::CAT_OBSERVATION;
}
} // setCatObservation()
/**
* Set the value of [cat_create_date] column.
*
* @param int $v new value
* @return void
*/
public function setCatCreateDate($v)
{
if ($v !== null && !is_int($v)) {
$ts = strtotime($v);
//Date/time accepts null values
if ($v == '') {
$ts = null;
}
if ($ts === -1 || $ts === false) {
throw new PropelException("Unable to parse date/time value for [cat_create_date] from input: " .
var_export($v, true));
}
} else {
$ts = $v;
}
if ($this->cat_create_date !== $ts) {
$this->cat_create_date = $ts;
$this->modifiedColumns[] = CatalogPeer::CAT_CREATE_DATE;
}
} // setCatCreateDate()
/**
* Set the value of [cat_update_date] column.
*
* @param int $v new value
* @return void
*/
public function setCatUpdateDate($v)
{
if ($v !== null && !is_int($v)) {
$ts = strtotime($v);
//Date/time accepts null values
if ($v == '') {
$ts = null;
}
if ($ts === -1 || $ts === false) {
throw new PropelException("Unable to parse date/time value for [cat_update_date] from input: " .
var_export($v, true));
}
} else {
$ts = $v;
}
if ($this->cat_update_date !== $ts) {
$this->cat_update_date = $ts;
$this->modifiedColumns[] = CatalogPeer::CAT_UPDATE_DATE;
}
} // setCatUpdateDate()
/**
* Hydrates (populates) the object variables with values from the database resultset.
*
* An offset (1-based "start column") is specified so that objects can be hydrated
* with a subset of the columns in the resultset rows. This is needed, for example,
* for results of JOIN queries where the resultset row includes columns from two or
* more tables.
*
* @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
* @param int $startcol 1-based offset column which indicates which restultset column to start with.
* @return int next starting column
* @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
*/
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->cat_uid = $rs->getString($startcol + 0);
$this->cat_label_id = $rs->getString($startcol + 1);
$this->cat_type = $rs->getString($startcol + 2);
$this->cat_flag = $rs->getString($startcol + 3);
$this->cat_observation = $rs->getString($startcol + 4);
$this->cat_create_date = $rs->getTimestamp($startcol + 5, null);
$this->cat_update_date = $rs->getTimestamp($startcol + 6, null);
$this->resetModified();
$this->setNew(false);
// FIXME - using NUM_COLUMNS may be clearer.
return $startcol + 7; // 7 = CatalogPeer::NUM_COLUMNS - CatalogPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating Catalog object", $e);
}
}
/**
* Removes this object from datastore and sets delete attribute.
*
* @param Connection $con
* @return void
* @throws PropelException
* @see BaseObject::setDeleted()
* @see BaseObject::isDeleted()
*/
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(CatalogPeer::DATABASE_NAME);
}
try {
$con->begin();
CatalogPeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Stores the object in the database. If the object is new,
* it inserts it; otherwise an update is performed. This method
* wraps the doSave() worker method in a transaction.
*
* @param Connection $con
* @return int The number of rows affected by this insert/update
* @throws PropelException
* @see doSave()
*/
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(CatalogPeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Stores the object in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param Connection $con
* @return int The number of rows affected by this insert/update and any referring
* @throws PropelException
* @see save()
*/
protected function doSave($con)
{
$affectedRows = 0; // initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
// If this object has been modified, then save it to the database.
if ($this->isModified()) {
if ($this->isNew()) {
$pk = CatalogPeer::doInsert($this, $con);
$affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
// should always be true here (even though technically
// BasePeer::doInsert() can insert multiple rows).
$this->setNew(false);
} else {
$affectedRows += CatalogPeer::doUpdate($this, $con);
}
$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
}
$this->alreadyInSave = false;
}
return $affectedRows;
} // doSave()
/**
* Array of ValidationFailed objects.
* @var array ValidationFailed[]
*/
protected $validationFailures = array();
/**
* Gets any ValidationFailed objects that resulted from last call to validate().
*
*
* @return array ValidationFailed[]
* @see validate()
*/
public function getValidationFailures()
{
return $this->validationFailures;
}
/**
* Validates the objects modified field values and all objects related to this table.
*
* If $columns is either a column name or an array of column names
* only those columns are validated.
*
* @param mixed $columns Column name or an array of column names.
* @return boolean Whether all columns pass validation.
* @see doValidate()
* @see getValidationFailures()
*/
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
/**
* This function performs the validation work for complex object models.
*
* In addition to checking the current object, all related objects will
* also be validated. If all pass then <code>true</code> is returned; otherwise
* an aggreagated array of ValidationFailed objects will be returned.
*
* @param array $columns Array of column names to validate.
* @return mixed <code>true</code> if all validations pass;
array of <code>ValidationFailed</code> objects otherwise.
*/
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if (($retval = CatalogPeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
/**
* Retrieves a field from the object by name passed in as a string.
*
* @param string $name name
* @param string $type The type of fieldname the $name is of:
* one of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @return mixed Value of field.
*/
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = CatalogPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
/**
* Retrieves a field from the object by Position as specified in the xml schema.
* Zero-based.
*
* @param int $pos position in xml schema
* @return mixed Value of field at $pos
*/
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getCatUid();
break;
case 1:
return $this->getCatLabelId();
break;
case 2:
return $this->getCatType();
break;
case 3:
return $this->getCatFlag();
break;
case 4:
return $this->getCatObservation();
break;
case 5:
return $this->getCatCreateDate();
break;
case 6:
return $this->getCatUpdateDate();
break;
default:
return null;
break;
} // switch()
}
/**
* Exports the object as an array.
*
* You can specify the key type of the array by passing one of the class
* type constants.
*
* @param string $keyType One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @return an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = CatalogPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getCatUid(),
$keys[1] => $this->getCatLabelId(),
$keys[2] => $this->getCatType(),
$keys[3] => $this->getCatFlag(),
$keys[4] => $this->getCatObservation(),
$keys[5] => $this->getCatCreateDate(),
$keys[6] => $this->getCatUpdateDate(),
);
return $result;
}
/**
* Sets a field from the object by name passed in as a string.
*
* @param string $name peer name
* @param mixed $value field value
* @param string $type The type of fieldname the $name is of:
* one of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @return void
*/
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = CatalogPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
/**
* Sets a field from the object by Position as specified in the xml schema.
* Zero-based.
*
* @param int $pos position in xml schema
* @param mixed $value field value
* @return void
*/
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setCatUid($value);
break;
case 1:
$this->setCatLabelId($value);
break;
case 2:
$this->setCatType($value);
break;
case 3:
$this->setCatFlag($value);
break;
case 4:
$this->setCatObservation($value);
break;
case 5:
$this->setCatCreateDate($value);
break;
case 6:
$this->setCatUpdateDate($value);
break;
} // switch()
}
/**
* Populates the object using an array.
*
* This is particularly useful when populating an object from one of the
* request arrays (e.g. $_POST). This method goes through the column
* names, checking to see whether a matching key exists in populated
* array. If so the setByName() method is called for that column.
*
* You can specify the key type of the array by additionally passing one
* of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
* TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
*
* @param array $arr An array to populate the object from.
* @param string $keyType The type of keys the array uses.
* @return void
*/
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = CatalogPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) {
$this->setCatUid($arr[$keys[0]]);
}
if (array_key_exists($keys[1], $arr)) {
$this->setCatLabelId($arr[$keys[1]]);
}
if (array_key_exists($keys[2], $arr)) {
$this->setCatType($arr[$keys[2]]);
}
if (array_key_exists($keys[3], $arr)) {
$this->setCatFlag($arr[$keys[3]]);
}
if (array_key_exists($keys[4], $arr)) {
$this->setCatObservation($arr[$keys[4]]);
}
if (array_key_exists($keys[5], $arr)) {
$this->setCatCreateDate($arr[$keys[5]]);
}
if (array_key_exists($keys[6], $arr)) {
$this->setCatUpdateDate($arr[$keys[6]]);
}
}
/**
* Build a Criteria object containing the values of all modified columns in this object.
*
* @return Criteria The Criteria object containing all modified values.
*/
public function buildCriteria()
{
$criteria = new Criteria(CatalogPeer::DATABASE_NAME);
if ($this->isColumnModified(CatalogPeer::CAT_UID)) {
$criteria->add(CatalogPeer::CAT_UID, $this->cat_uid);
}
if ($this->isColumnModified(CatalogPeer::CAT_LABEL_ID)) {
$criteria->add(CatalogPeer::CAT_LABEL_ID, $this->cat_label_id);
}
if ($this->isColumnModified(CatalogPeer::CAT_TYPE)) {
$criteria->add(CatalogPeer::CAT_TYPE, $this->cat_type);
}
if ($this->isColumnModified(CatalogPeer::CAT_FLAG)) {
$criteria->add(CatalogPeer::CAT_FLAG, $this->cat_flag);
}
if ($this->isColumnModified(CatalogPeer::CAT_OBSERVATION)) {
$criteria->add(CatalogPeer::CAT_OBSERVATION, $this->cat_observation);
}
if ($this->isColumnModified(CatalogPeer::CAT_CREATE_DATE)) {
$criteria->add(CatalogPeer::CAT_CREATE_DATE, $this->cat_create_date);
}
if ($this->isColumnModified(CatalogPeer::CAT_UPDATE_DATE)) {
$criteria->add(CatalogPeer::CAT_UPDATE_DATE, $this->cat_update_date);
}
return $criteria;
}
/**
* Builds a Criteria object containing the primary key for this object.
*
* Unlike buildCriteria() this method includes the primary key values regardless
* of whether or not they have been modified.
*
* @return Criteria The Criteria object containing value(s) for primary key(s).
*/
public function buildPkeyCriteria()
{
$criteria = new Criteria(CatalogPeer::DATABASE_NAME);
$criteria->add(CatalogPeer::CAT_UID, $this->cat_uid);
$criteria->add(CatalogPeer::CAT_TYPE, $this->cat_type);
return $criteria;
}
/**
* Returns the composite primary key for this object.
* The array elements will be in same order as specified in XML.
* @return array
*/
public function getPrimaryKey()
{
$pks = array();
$pks[0] = $this->getCatUid();
$pks[1] = $this->getCatType();
return $pks;
}
/**
* Set the [composite] primary key.
*
* @param array $keys The elements of the composite key (order must match the order in XML file).
* @return void
*/
public function setPrimaryKey($keys)
{
$this->setCatUid($keys[0]);
$this->setCatType($keys[1]);
}
/**
* Sets contents of passed object to values from current object.
*
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param object $copyObj An object of Catalog (or compatible) type.
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @throws PropelException
*/
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setCatLabelId($this->cat_label_id);
$copyObj->setCatFlag($this->cat_flag);
$copyObj->setCatObservation($this->cat_observation);
$copyObj->setCatCreateDate($this->cat_create_date);
$copyObj->setCatUpdateDate($this->cat_update_date);
$copyObj->setNew(true);
$copyObj->setCatUid('0'); // this is a pkey column, so set to default value
$copyObj->setCatType(''); // this is a pkey column, so set to default value
}
/**
* Makes a copy of this object that will be inserted as a new row in table when saved.
* It creates a new object filling in the simple attributes, but skipping any primary
* keys that are defined for the table.
*
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @return Catalog Clone of current object.
* @throws PropelException
*/
public function copy($deepCopy = false)
{
// we use get_class(), because this might be a subclass
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
/**
* Returns a peer instance associated with this om.
*
* Since Peer classes are not to have any instance attributes, this method returns the
* same instance for all member of this class. The method could therefore
* be static, but this would prevent one from overriding the behavior.
*
* @return CatalogPeer
*/
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new CatalogPeer();
}
return self::$peer;
}
}

View File

@@ -0,0 +1,587 @@
<?php
require_once 'propel/util/BasePeer.php';
// The object class -- needed for instanceof checks in this class.
// actual class may be a subclass -- as returned by CatalogPeer::getOMClass()
include_once 'classes/model/Catalog.php';
/**
* Base static class for performing query and update operations on the 'CATALOG' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BaseCatalogPeer
{
/** the default database name for this class */
const DATABASE_NAME = 'workflow';
/** the table name for this class */
const TABLE_NAME = 'CATALOG';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'classes.model.Catalog';
/** The total number of columns. */
const NUM_COLUMNS = 7;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the CAT_UID field */
const CAT_UID = 'CATALOG.CAT_UID';
/** the column name for the CAT_LABEL_ID field */
const CAT_LABEL_ID = 'CATALOG.CAT_LABEL_ID';
/** the column name for the CAT_TYPE field */
const CAT_TYPE = 'CATALOG.CAT_TYPE';
/** the column name for the CAT_FLAG field */
const CAT_FLAG = 'CATALOG.CAT_FLAG';
/** the column name for the CAT_OBSERVATION field */
const CAT_OBSERVATION = 'CATALOG.CAT_OBSERVATION';
/** the column name for the CAT_CREATE_DATE field */
const CAT_CREATE_DATE = 'CATALOG.CAT_CREATE_DATE';
/** the column name for the CAT_UPDATE_DATE field */
const CAT_UPDATE_DATE = 'CATALOG.CAT_UPDATE_DATE';
/** The PHP to DB Name Mapping */
private static $phpNameMap = null;
/**
* holds an array of fieldnames
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('CatUid', 'CatLabelId', 'CatType', 'CatFlag', 'CatObservation', 'CatCreateDate', 'CatUpdateDate', ),
BasePeer::TYPE_COLNAME => array (CatalogPeer::CAT_UID, CatalogPeer::CAT_LABEL_ID, CatalogPeer::CAT_TYPE, CatalogPeer::CAT_FLAG, CatalogPeer::CAT_OBSERVATION, CatalogPeer::CAT_CREATE_DATE, CatalogPeer::CAT_UPDATE_DATE, ),
BasePeer::TYPE_FIELDNAME => array ('CAT_UID', 'CAT_LABEL_ID', 'CAT_TYPE', 'CAT_FLAG', 'CAT_OBSERVATION', 'CAT_CREATE_DATE', 'CAT_UPDATE_DATE', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
);
/**
* holds an array of keys for quick access to the fieldnames array
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('CatUid' => 0, 'CatLabelId' => 1, 'CatType' => 2, 'CatFlag' => 3, 'CatObservation' => 4, 'CatCreateDate' => 5, 'CatUpdateDate' => 6, ),
BasePeer::TYPE_COLNAME => array (CatalogPeer::CAT_UID => 0, CatalogPeer::CAT_LABEL_ID => 1, CatalogPeer::CAT_TYPE => 2, CatalogPeer::CAT_FLAG => 3, CatalogPeer::CAT_OBSERVATION => 4, CatalogPeer::CAT_CREATE_DATE => 5, CatalogPeer::CAT_UPDATE_DATE => 6, ),
BasePeer::TYPE_FIELDNAME => array ('CAT_UID' => 0, 'CAT_LABEL_ID' => 1, 'CAT_TYPE' => 2, 'CAT_FLAG' => 3, 'CAT_OBSERVATION' => 4, 'CAT_CREATE_DATE' => 5, 'CAT_UPDATE_DATE' => 6, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
);
/**
* @return MapBuilder the map builder for this peer
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getMapBuilder()
{
include_once 'classes/model/map/CatalogMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.CatalogMapBuilder');
}
/**
* Gets a map (hash) of PHP names to DB column names.
*
* @return array The PHP to DB name map for this peer
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
*/
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = CatalogPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
/**
* Translates a fieldname to another type
*
* @param string $name field name
* @param string $fromType One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @param string $toType One of the class type constants
* @return string translated name of the field.
*/
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
/**
* Returns an array of of field names.
*
* @param string $type The type of fieldnames to return:
* One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @return array A list of field names
*/
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
/**
* Convenience method which changes table.column to alias.column.
*
* Using this method you can maintain SQL abstraction while using column aliases.
* <code>
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
* </code>
* @param string $alias The alias for the current table.
* @param string $column The column name for current table. (i.e. CatalogPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(CatalogPeer::TABLE_NAME.'.', $alias.'.', $column);
}
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param criteria object containing the columns to add.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(CatalogPeer::CAT_UID);
$criteria->addSelectColumn(CatalogPeer::CAT_LABEL_ID);
$criteria->addSelectColumn(CatalogPeer::CAT_TYPE);
$criteria->addSelectColumn(CatalogPeer::CAT_FLAG);
$criteria->addSelectColumn(CatalogPeer::CAT_OBSERVATION);
$criteria->addSelectColumn(CatalogPeer::CAT_CREATE_DATE);
$criteria->addSelectColumn(CatalogPeer::CAT_UPDATE_DATE);
}
const COUNT = 'COUNT(CATALOG.CAT_UID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT CATALOG.CAT_UID)';
/**
* Returns the number of rows matching criteria.
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
* @param Connection $con
* @return int Number of matching rows.
*/
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// clear out anything that might confuse the ORDER BY clause
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(CatalogPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(CatalogPeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach ($criteria->getGroupByColumns() as $column) {
$criteria->addSelectColumn($column);
}
$rs = CatalogPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
// no rows returned; we infer that means 0 matches.
return 0;
}
}
/**
* Method to select one object from the DB.
*
* @param Criteria $criteria object used to create the SELECT statement.
* @param Connection $con
* @return Catalog
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = CatalogPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
/**
* Method to do selects.
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con
* @return array Array of selected Objects
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelect(Criteria $criteria, $con = null)
{
return CatalogPeer::populateObjects(CatalogPeer::doSelectRS($criteria, $con));
}
/**
* Prepares the Criteria object and uses the parent doSelect()
* method to get a ResultSet.
*
* Use this method directly if you want to just get the resultset
* (instead of an array of objects).
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return ResultSet The resultset object with numerically-indexed fields.
* @see BasePeer::doSelect()
*/
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
CatalogPeer::addSelectColumns($criteria);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
// BasePeer returns a Creole ResultSet, set to return
// rows indexed numerically.
return BasePeer::doSelect($criteria, $con);
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(ResultSet $rs)
{
$results = array();
// set the class once to avoid overhead in the loop
$cls = CatalogPeer::getOMClass();
$cls = Propel::import($cls);
// populate the object(s)
while ($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
/**
* Returns the TableMap related to this peer.
* This method is not needed for general use but a specific application could have a need.
* @return TableMap
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
/**
* The class that the Peer will make instances of.
*
* This uses a dot-path notation which is tranalted into a path
* relative to a location on the PHP include_path.
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
*
* @return string path.to.ClassName
*/
public static function getOMClass()
{
return CatalogPeer::CLASS_DEFAULT;
}
/**
* Method perform an INSERT on the database, given a Catalog or Criteria object.
*
* @param mixed $values Criteria or Catalog object containing data that is used to create the INSERT statement.
* @param Connection $con the connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from Catalog object
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
try {
// use transaction because $criteria could contain info
// for more than one table (I guess, conceivably)
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
/**
* Method perform an UPDATE on the database, given a Catalog or Criteria object.
*
* @param mixed $values Criteria or Catalog object containing data create the UPDATE statement.
* @param Connection $con The connection to use (specify Connection exert more control over transactions).
* @return int The number of affected rows (if supported by underlying database driver).
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(CatalogPeer::CAT_UID);
$selectCriteria->add(CatalogPeer::CAT_UID, $criteria->remove(CatalogPeer::CAT_UID), $comparison);
$comparison = $criteria->getComparison(CatalogPeer::CAT_TYPE);
$selectCriteria->add(CatalogPeer::CAT_TYPE, $criteria->remove(CatalogPeer::CAT_TYPE), $comparison);
} else {
$criteria = $values->buildCriteria(); // gets full criteria
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
}
// set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
/**
* Method to DELETE all rows from the CATALOG table.
*
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDeleteAll(CatalogPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a Catalog or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or Catalog object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param Connection $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
* This includes CASCADE-related rows
* if supported by native driver or if emulated using Propel.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(CatalogPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} elseif ($values instanceof Catalog) {
$criteria = $values->buildPkeyCriteria();
} else {
// it must be the primary key
$criteria = new Criteria(self::DATABASE_NAME);
// primary key is composite; we therefore, expect
// the primary key passed to be an array of pkey
// values
if (count($values) == count($values, COUNT_RECURSIVE)) {
// array is not multi-dimensional
$values = array($values);
}
$vals = array();
foreach ($values as $value) {
$vals[0][] = $value[0];
$vals[1][] = $value[1];
}
$criteria->add(CatalogPeer::CAT_UID, $vals[0], Criteria::IN);
$criteria->add(CatalogPeer::CAT_TYPE, $vals[1], Criteria::IN);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Validates all modified columns of given Catalog object.
* If parameter $columns is either a single column name or an array of column names
* than only those columns are validated.
*
* NOTICE: This does not apply to primary or foreign keys for now.
*
* @param Catalog $obj The object to validate.
* @param mixed $cols Column name or array of column names.
*
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
*/
public static function doValidate(Catalog $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(CatalogPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(CatalogPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach ($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
return BasePeer::doValidate(CatalogPeer::DATABASE_NAME, CatalogPeer::TABLE_NAME, $columns);
}
/**
* Retrieve object using using composite pkey values.
* @param string $cat_uid
* @param string $cat_type
* @param Connection $con
* @return Catalog
*/
public static function retrieveByPK($cat_uid, $cat_type, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria();
$criteria->add(CatalogPeer::CAT_UID, $cat_uid);
$criteria->add(CatalogPeer::CAT_TYPE, $cat_type);
$v = CatalogPeer::doSelect($criteria, $con);
return !empty($v) ? $v[0] : null;
}
}
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
// the MapBuilder classes register themselves with Propel during initialization
// so we need to load them here.
try {
BaseCatalogPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
// even if Propel is not yet initialized, the map builder class can be registered
// now and then it will be loaded when Propel initializes.
require_once 'classes/model/map/CatalogMapBuilder.php';
Propel::registerMapBuilder('classes.model.map.CatalogMapBuilder');
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,723 @@
<?php
require_once 'propel/om/BaseObject.php';
require_once 'propel/om/Persistent.php';
include_once 'propel/util/Criteria.php';
include_once 'classes/model/DashboardDasIndPeer.php';
/**
* Base class that represents a row from the 'DASHBOARD_DAS_IND' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BaseDashboardDasInd extends BaseObject implements Persistent
{
/**
* The Peer class.
* Instance provides a convenient way of calling static methods on a class
* that calling code may not be able to identify.
* @var DashboardDasIndPeer
*/
protected static $peer;
/**
* The value for the das_uid field.
* @var string
*/
protected $das_uid = '';
/**
* The value for the owner_uid field.
* @var string
*/
protected $owner_uid = '';
/**
* The value for the owner_type field.
* @var string
*/
protected $owner_type = '';
/**
* @var Dashboard
*/
protected $aDashboard;
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
* @var boolean
*/
protected $alreadyInSave = false;
/**
* Flag to prevent endless validation loop, if this object is referenced
* by another object which falls in this transaction.
* @var boolean
*/
protected $alreadyInValidation = false;
/**
* Get the [das_uid] column value.
*
* @return string
*/
public function getDasUid()
{
return $this->das_uid;
}
/**
* Get the [owner_uid] column value.
*
* @return string
*/
public function getOwnerUid()
{
return $this->owner_uid;
}
/**
* Get the [owner_type] column value.
*
* @return string
*/
public function getOwnerType()
{
return $this->owner_type;
}
/**
* Set the value of [das_uid] column.
*
* @param string $v new value
* @return void
*/
public function setDasUid($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->das_uid !== $v || $v === '') {
$this->das_uid = $v;
$this->modifiedColumns[] = DashboardDasIndPeer::DAS_UID;
}
if ($this->aDashboard !== null && $this->aDashboard->getDasUid() !== $v) {
$this->aDashboard = null;
}
} // setDasUid()
/**
* Set the value of [owner_uid] column.
*
* @param string $v new value
* @return void
*/
public function setOwnerUid($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->owner_uid !== $v || $v === '') {
$this->owner_uid = $v;
$this->modifiedColumns[] = DashboardDasIndPeer::OWNER_UID;
}
} // setOwnerUid()
/**
* Set the value of [owner_type] column.
*
* @param string $v new value
* @return void
*/
public function setOwnerType($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->owner_type !== $v || $v === '') {
$this->owner_type = $v;
$this->modifiedColumns[] = DashboardDasIndPeer::OWNER_TYPE;
}
} // setOwnerType()
/**
* Hydrates (populates) the object variables with values from the database resultset.
*
* An offset (1-based "start column") is specified so that objects can be hydrated
* with a subset of the columns in the resultset rows. This is needed, for example,
* for results of JOIN queries where the resultset row includes columns from two or
* more tables.
*
* @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
* @param int $startcol 1-based offset column which indicates which restultset column to start with.
* @return int next starting column
* @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
*/
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->das_uid = $rs->getString($startcol + 0);
$this->owner_uid = $rs->getString($startcol + 1);
$this->owner_type = $rs->getString($startcol + 2);
$this->resetModified();
$this->setNew(false);
// FIXME - using NUM_COLUMNS may be clearer.
return $startcol + 3; // 3 = DashboardDasIndPeer::NUM_COLUMNS - DashboardDasIndPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating DashboardDasInd object", $e);
}
}
/**
* Removes this object from datastore and sets delete attribute.
*
* @param Connection $con
* @return void
* @throws PropelException
* @see BaseObject::setDeleted()
* @see BaseObject::isDeleted()
*/
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(DashboardDasIndPeer::DATABASE_NAME);
}
try {
$con->begin();
DashboardDasIndPeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Stores the object in the database. If the object is new,
* it inserts it; otherwise an update is performed. This method
* wraps the doSave() worker method in a transaction.
*
* @param Connection $con
* @return int The number of rows affected by this insert/update
* @throws PropelException
* @see doSave()
*/
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(DashboardDasIndPeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Stores the object in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param Connection $con
* @return int The number of rows affected by this insert/update and any referring
* @throws PropelException
* @see save()
*/
protected function doSave($con)
{
$affectedRows = 0; // initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
// We call the save method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->aDashboard !== null) {
if ($this->aDashboard->isModified()) {
$affectedRows += $this->aDashboard->save($con);
}
$this->setDashboard($this->aDashboard);
}
// If this object has been modified, then save it to the database.
if ($this->isModified()) {
if ($this->isNew()) {
$pk = DashboardDasIndPeer::doInsert($this, $con);
$affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
// should always be true here (even though technically
// BasePeer::doInsert() can insert multiple rows).
$this->setNew(false);
} else {
$affectedRows += DashboardDasIndPeer::doUpdate($this, $con);
}
$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
}
$this->alreadyInSave = false;
}
return $affectedRows;
} // doSave()
/**
* Array of ValidationFailed objects.
* @var array ValidationFailed[]
*/
protected $validationFailures = array();
/**
* Gets any ValidationFailed objects that resulted from last call to validate().
*
*
* @return array ValidationFailed[]
* @see validate()
*/
public function getValidationFailures()
{
return $this->validationFailures;
}
/**
* Validates the objects modified field values and all objects related to this table.
*
* If $columns is either a column name or an array of column names
* only those columns are validated.
*
* @param mixed $columns Column name or an array of column names.
* @return boolean Whether all columns pass validation.
* @see doValidate()
* @see getValidationFailures()
*/
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
/**
* This function performs the validation work for complex object models.
*
* In addition to checking the current object, all related objects will
* also be validated. If all pass then <code>true</code> is returned; otherwise
* an aggreagated array of ValidationFailed objects will be returned.
*
* @param array $columns Array of column names to validate.
* @return mixed <code>true</code> if all validations pass;
array of <code>ValidationFailed</code> objects otherwise.
*/
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
// We call the validate method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->aDashboard !== null) {
if (!$this->aDashboard->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aDashboard->getValidationFailures());
}
}
if (($retval = DashboardDasIndPeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
/**
* Retrieves a field from the object by name passed in as a string.
*
* @param string $name name
* @param string $type The type of fieldname the $name is of:
* one of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @return mixed Value of field.
*/
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = DashboardDasIndPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
/**
* Retrieves a field from the object by Position as specified in the xml schema.
* Zero-based.
*
* @param int $pos position in xml schema
* @return mixed Value of field at $pos
*/
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getDasUid();
break;
case 1:
return $this->getOwnerUid();
break;
case 2:
return $this->getOwnerType();
break;
default:
return null;
break;
} // switch()
}
/**
* Exports the object as an array.
*
* You can specify the key type of the array by passing one of the class
* type constants.
*
* @param string $keyType One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @return an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = DashboardDasIndPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getDasUid(),
$keys[1] => $this->getOwnerUid(),
$keys[2] => $this->getOwnerType(),
);
return $result;
}
/**
* Sets a field from the object by name passed in as a string.
*
* @param string $name peer name
* @param mixed $value field value
* @param string $type The type of fieldname the $name is of:
* one of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @return void
*/
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = DashboardDasIndPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
/**
* Sets a field from the object by Position as specified in the xml schema.
* Zero-based.
*
* @param int $pos position in xml schema
* @param mixed $value field value
* @return void
*/
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setDasUid($value);
break;
case 1:
$this->setOwnerUid($value);
break;
case 2:
$this->setOwnerType($value);
break;
} // switch()
}
/**
* Populates the object using an array.
*
* This is particularly useful when populating an object from one of the
* request arrays (e.g. $_POST). This method goes through the column
* names, checking to see whether a matching key exists in populated
* array. If so the setByName() method is called for that column.
*
* You can specify the key type of the array by additionally passing one
* of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
* TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
*
* @param array $arr An array to populate the object from.
* @param string $keyType The type of keys the array uses.
* @return void
*/
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = DashboardDasIndPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) {
$this->setDasUid($arr[$keys[0]]);
}
if (array_key_exists($keys[1], $arr)) {
$this->setOwnerUid($arr[$keys[1]]);
}
if (array_key_exists($keys[2], $arr)) {
$this->setOwnerType($arr[$keys[2]]);
}
}
/**
* Build a Criteria object containing the values of all modified columns in this object.
*
* @return Criteria The Criteria object containing all modified values.
*/
public function buildCriteria()
{
$criteria = new Criteria(DashboardDasIndPeer::DATABASE_NAME);
if ($this->isColumnModified(DashboardDasIndPeer::DAS_UID)) {
$criteria->add(DashboardDasIndPeer::DAS_UID, $this->das_uid);
}
if ($this->isColumnModified(DashboardDasIndPeer::OWNER_UID)) {
$criteria->add(DashboardDasIndPeer::OWNER_UID, $this->owner_uid);
}
if ($this->isColumnModified(DashboardDasIndPeer::OWNER_TYPE)) {
$criteria->add(DashboardDasIndPeer::OWNER_TYPE, $this->owner_type);
}
return $criteria;
}
/**
* Builds a Criteria object containing the primary key for this object.
*
* Unlike buildCriteria() this method includes the primary key values regardless
* of whether or not they have been modified.
*
* @return Criteria The Criteria object containing value(s) for primary key(s).
*/
public function buildPkeyCriteria()
{
$criteria = new Criteria(DashboardDasIndPeer::DATABASE_NAME);
$criteria->add(DashboardDasIndPeer::DAS_UID, $this->das_uid);
$criteria->add(DashboardDasIndPeer::OWNER_UID, $this->owner_uid);
return $criteria;
}
/**
* Returns the composite primary key for this object.
* The array elements will be in same order as specified in XML.
* @return array
*/
public function getPrimaryKey()
{
$pks = array();
$pks[0] = $this->getDasUid();
$pks[1] = $this->getOwnerUid();
return $pks;
}
/**
* Set the [composite] primary key.
*
* @param array $keys The elements of the composite key (order must match the order in XML file).
* @return void
*/
public function setPrimaryKey($keys)
{
$this->setDasUid($keys[0]);
$this->setOwnerUid($keys[1]);
}
/**
* Sets contents of passed object to values from current object.
*
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param object $copyObj An object of DashboardDasInd (or compatible) type.
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @throws PropelException
*/
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setOwnerType($this->owner_type);
$copyObj->setNew(true);
$copyObj->setDasUid(''); // this is a pkey column, so set to default value
$copyObj->setOwnerUid(''); // this is a pkey column, so set to default value
}
/**
* Makes a copy of this object that will be inserted as a new row in table when saved.
* It creates a new object filling in the simple attributes, but skipping any primary
* keys that are defined for the table.
*
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @return DashboardDasInd Clone of current object.
* @throws PropelException
*/
public function copy($deepCopy = false)
{
// we use get_class(), because this might be a subclass
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
/**
* Returns a peer instance associated with this om.
*
* Since Peer classes are not to have any instance attributes, this method returns the
* same instance for all member of this class. The method could therefore
* be static, but this would prevent one from overriding the behavior.
*
* @return DashboardDasIndPeer
*/
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new DashboardDasIndPeer();
}
return self::$peer;
}
/**
* Declares an association between this object and a Dashboard object.
*
* @param Dashboard $v
* @return void
* @throws PropelException
*/
public function setDashboard($v)
{
if ($v === null) {
$this->setDasUid('');
} else {
$this->setDasUid($v->getDasUid());
}
$this->aDashboard = $v;
}
/**
* Get the associated Dashboard object
*
* @param Connection Optional Connection object.
* @return Dashboard The associated Dashboard object.
* @throws PropelException
*/
public function getDashboard($con = null)
{
// include the related Peer class
include_once 'classes/model/om/BaseDashboardPeer.php';
if ($this->aDashboard === null && (($this->das_uid !== "" && $this->das_uid !== null))) {
$this->aDashboard = DashboardPeer::retrieveByPK($this->das_uid, $con);
/* The following can be used instead of the line above to
guarantee the related object contains a reference
to this object, but this level of coupling
may be undesirable in many circumstances.
As it can lead to a db query with many results that may
never be used.
$obj = DashboardPeer::retrieveByPK($this->das_uid, $con);
$obj->addDashboards($this);
*/
}
return $this->aDashboard;
}
}

View File

@@ -0,0 +1,770 @@
<?php
require_once 'propel/util/BasePeer.php';
// The object class -- needed for instanceof checks in this class.
// actual class may be a subclass -- as returned by DashboardDasIndPeer::getOMClass()
include_once 'classes/model/DashboardDasInd.php';
/**
* Base static class for performing query and update operations on the 'DASHBOARD_DAS_IND' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BaseDashboardDasIndPeer
{
/** the default database name for this class */
const DATABASE_NAME = 'workflow';
/** the table name for this class */
const TABLE_NAME = 'DASHBOARD_DAS_IND';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'classes.model.DashboardDasInd';
/** The total number of columns. */
const NUM_COLUMNS = 3;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the DAS_UID field */
const DAS_UID = 'DASHBOARD_DAS_IND.DAS_UID';
/** the column name for the OWNER_UID field */
const OWNER_UID = 'DASHBOARD_DAS_IND.OWNER_UID';
/** the column name for the OWNER_TYPE field */
const OWNER_TYPE = 'DASHBOARD_DAS_IND.OWNER_TYPE';
/** The PHP to DB Name Mapping */
private static $phpNameMap = null;
/**
* holds an array of fieldnames
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DasUid', 'OwnerUid', 'OwnerType', ),
BasePeer::TYPE_COLNAME => array (DashboardDasIndPeer::DAS_UID, DashboardDasIndPeer::OWNER_UID, DashboardDasIndPeer::OWNER_TYPE, ),
BasePeer::TYPE_FIELDNAME => array ('DAS_UID', 'OWNER_UID', 'OWNER_TYPE', ),
BasePeer::TYPE_NUM => array (0, 1, 2, )
);
/**
* holds an array of keys for quick access to the fieldnames array
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DasUid' => 0, 'OwnerUid' => 1, 'OwnerType' => 2, ),
BasePeer::TYPE_COLNAME => array (DashboardDasIndPeer::DAS_UID => 0, DashboardDasIndPeer::OWNER_UID => 1, DashboardDasIndPeer::OWNER_TYPE => 2, ),
BasePeer::TYPE_FIELDNAME => array ('DAS_UID' => 0, 'OWNER_UID' => 1, 'OWNER_TYPE' => 2, ),
BasePeer::TYPE_NUM => array (0, 1, 2, )
);
/**
* @return MapBuilder the map builder for this peer
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getMapBuilder()
{
include_once 'classes/model/map/DashboardDasIndMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.DashboardDasIndMapBuilder');
}
/**
* Gets a map (hash) of PHP names to DB column names.
*
* @return array The PHP to DB name map for this peer
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
*/
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = DashboardDasIndPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
/**
* Translates a fieldname to another type
*
* @param string $name field name
* @param string $fromType One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @param string $toType One of the class type constants
* @return string translated name of the field.
*/
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
/**
* Returns an array of of field names.
*
* @param string $type The type of fieldnames to return:
* One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @return array A list of field names
*/
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
/**
* Convenience method which changes table.column to alias.column.
*
* Using this method you can maintain SQL abstraction while using column aliases.
* <code>
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
* </code>
* @param string $alias The alias for the current table.
* @param string $column The column name for current table. (i.e. DashboardDasIndPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(DashboardDasIndPeer::TABLE_NAME.'.', $alias.'.', $column);
}
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param criteria object containing the columns to add.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(DashboardDasIndPeer::DAS_UID);
$criteria->addSelectColumn(DashboardDasIndPeer::OWNER_UID);
$criteria->addSelectColumn(DashboardDasIndPeer::OWNER_TYPE);
}
const COUNT = 'COUNT(DASHBOARD_DAS_IND.DAS_UID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT DASHBOARD_DAS_IND.DAS_UID)';
/**
* Returns the number of rows matching criteria.
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
* @param Connection $con
* @return int Number of matching rows.
*/
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// clear out anything that might confuse the ORDER BY clause
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(DashboardDasIndPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(DashboardDasIndPeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach ($criteria->getGroupByColumns() as $column) {
$criteria->addSelectColumn($column);
}
$rs = DashboardDasIndPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
// no rows returned; we infer that means 0 matches.
return 0;
}
}
/**
* Method to select one object from the DB.
*
* @param Criteria $criteria object used to create the SELECT statement.
* @param Connection $con
* @return DashboardDasInd
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = DashboardDasIndPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
/**
* Method to do selects.
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con
* @return array Array of selected Objects
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelect(Criteria $criteria, $con = null)
{
return DashboardDasIndPeer::populateObjects(DashboardDasIndPeer::doSelectRS($criteria, $con));
}
/**
* Prepares the Criteria object and uses the parent doSelect()
* method to get a ResultSet.
*
* Use this method directly if you want to just get the resultset
* (instead of an array of objects).
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return ResultSet The resultset object with numerically-indexed fields.
* @see BasePeer::doSelect()
*/
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
DashboardDasIndPeer::addSelectColumns($criteria);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
// BasePeer returns a Creole ResultSet, set to return
// rows indexed numerically.
return BasePeer::doSelect($criteria, $con);
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(ResultSet $rs)
{
$results = array();
// set the class once to avoid overhead in the loop
$cls = DashboardDasIndPeer::getOMClass();
$cls = Propel::import($cls);
// populate the object(s)
while ($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
/**
* Returns the number of rows matching criteria, joining the related Dashboard table
*
* @param Criteria $c
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
* @param Connection $con
* @return int Number of matching rows.
*/
public static function doCountJoinDashboard(Criteria $criteria, $distinct = false, $con = null)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// clear out anything that might confuse the ORDER BY clause
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(DashboardDasIndPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(DashboardDasIndPeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(DashboardDasIndPeer::DAS_UID, DashboardPeer::DAS_UID);
$rs = DashboardDasIndPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
// no rows returned; we infer that means 0 matches.
return 0;
}
}
/**
* Selects a collection of DashboardDasInd objects pre-filled with their Dashboard objects.
*
* @return array Array of DashboardDasInd objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinDashboard(Criteria $c, $con = null)
{
$c = clone $c;
// Set the correct dbName if it has not been overridden
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
DashboardDasIndPeer::addSelectColumns($c);
$startcol = (DashboardDasIndPeer::NUM_COLUMNS - DashboardDasIndPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
DashboardPeer::addSelectColumns($c);
$c->addJoin(DashboardDasIndPeer::DAS_UID, DashboardPeer::DAS_UID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = DashboardDasIndPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = DashboardPeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$newObject = true;
foreach($results as $temp_obj1) {
$temp_obj2 = $temp_obj1->getDashboard(); //CHECKME
if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
// e.g. $author->addBookRelatedByBookId()
$temp_obj2->addDashboardDasInd($obj1); //CHECKME
break;
}
}
if ($newObject) {
$obj2->initDashboardDasInds();
$obj2->addDashboardDasInd($obj1); //CHECKME
}
$results[] = $obj1;
}
return $results;
}
/**
* Returns the number of rows matching criteria, joining all related tables
*
* @param Criteria $c
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
* @param Connection $con
* @return int Number of matching rows.
*/
public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
// clear out anything that might confuse the ORDER BY clause
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(DashboardDasIndPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(DashboardDasIndPeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(DashboardDasIndPeer::DAS_UID, DashboardPeer::DAS_UID);
$rs = DashboardDasIndPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
// no rows returned; we infer that means 0 matches.
return 0;
}
}
/**
* Selects a collection of DashboardDasInd objects pre-filled with all related objects.
*
* @return array Array of DashboardDasInd objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAll(Criteria $c, $con = null)
{
$c = clone $c;
// Set the correct dbName if it has not been overridden
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
DashboardDasIndPeer::addSelectColumns($c);
$startcol2 = (DashboardDasIndPeer::NUM_COLUMNS - DashboardDasIndPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
DashboardPeer::addSelectColumns($c);
$startcol3 = $startcol2 + DashboardPeer::NUM_COLUMNS;
$c->addJoin(DashboardDasIndPeer::DAS_UID, DashboardPeer::DAS_UID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = DashboardDasIndPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
// Add objects for joined Dashboard rows
$omClass = DashboardPeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol2);
$newObject = true;
for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
$temp_obj1 = $results[$j];
$temp_obj2 = $temp_obj1->getDashboard(); // CHECKME
if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addDashboardDasInd($obj1); // CHECKME
break;
}
}
if ($newObject) {
$obj2->initDashboardDasInds();
$obj2->addDashboardDasInd($obj1);
}
$results[] = $obj1;
}
return $results;
}
/**
* Returns the TableMap related to this peer.
* This method is not needed for general use but a specific application could have a need.
* @return TableMap
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
/**
* The class that the Peer will make instances of.
*
* This uses a dot-path notation which is tranalted into a path
* relative to a location on the PHP include_path.
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
*
* @return string path.to.ClassName
*/
public static function getOMClass()
{
return DashboardDasIndPeer::CLASS_DEFAULT;
}
/**
* Method perform an INSERT on the database, given a DashboardDasInd or Criteria object.
*
* @param mixed $values Criteria or DashboardDasInd object containing data that is used to create the INSERT statement.
* @param Connection $con the connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from DashboardDasInd object
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
try {
// use transaction because $criteria could contain info
// for more than one table (I guess, conceivably)
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
/**
* Method perform an UPDATE on the database, given a DashboardDasInd or Criteria object.
*
* @param mixed $values Criteria or DashboardDasInd object containing data create the UPDATE statement.
* @param Connection $con The connection to use (specify Connection exert more control over transactions).
* @return int The number of affected rows (if supported by underlying database driver).
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(DashboardDasIndPeer::DAS_UID);
$selectCriteria->add(DashboardDasIndPeer::DAS_UID, $criteria->remove(DashboardDasIndPeer::DAS_UID), $comparison);
$comparison = $criteria->getComparison(DashboardDasIndPeer::OWNER_UID);
$selectCriteria->add(DashboardDasIndPeer::OWNER_UID, $criteria->remove(DashboardDasIndPeer::OWNER_UID), $comparison);
} else {
$criteria = $values->buildCriteria(); // gets full criteria
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
}
// set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
/**
* Method to DELETE all rows from the DASHBOARD_DAS_IND table.
*
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDeleteAll(DashboardDasIndPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a DashboardDasInd or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or DashboardDasInd object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param Connection $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
* This includes CASCADE-related rows
* if supported by native driver or if emulated using Propel.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(DashboardDasIndPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} elseif ($values instanceof DashboardDasInd) {
$criteria = $values->buildPkeyCriteria();
} else {
// it must be the primary key
$criteria = new Criteria(self::DATABASE_NAME);
// primary key is composite; we therefore, expect
// the primary key passed to be an array of pkey
// values
if (count($values) == count($values, COUNT_RECURSIVE)) {
// array is not multi-dimensional
$values = array($values);
}
$vals = array();
foreach ($values as $value) {
$vals[0][] = $value[0];
$vals[1][] = $value[1];
}
$criteria->add(DashboardDasIndPeer::DAS_UID, $vals[0], Criteria::IN);
$criteria->add(DashboardDasIndPeer::OWNER_UID, $vals[1], Criteria::IN);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Validates all modified columns of given DashboardDasInd object.
* If parameter $columns is either a single column name or an array of column names
* than only those columns are validated.
*
* NOTICE: This does not apply to primary or foreign keys for now.
*
* @param DashboardDasInd $obj The object to validate.
* @param mixed $cols Column name or array of column names.
*
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
*/
public static function doValidate(DashboardDasInd $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(DashboardDasIndPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(DashboardDasIndPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach ($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
return BasePeer::doValidate(DashboardDasIndPeer::DATABASE_NAME, DashboardDasIndPeer::TABLE_NAME, $columns);
}
/**
* Retrieve object using using composite pkey values.
* @param string $das_uid
* @param string $owner_uid
* @param Connection $con
* @return DashboardDasInd
*/
public static function retrieveByPK($das_uid, $owner_uid, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria();
$criteria->add(DashboardDasIndPeer::DAS_UID, $das_uid);
$criteria->add(DashboardDasIndPeer::OWNER_UID, $owner_uid);
$v = DashboardDasIndPeer::doSelect($criteria, $con);
return !empty($v) ? $v[0] : null;
}
}
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
// the MapBuilder classes register themselves with Propel during initialization
// so we need to load them here.
try {
BaseDashboardDasIndPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
// even if Propel is not yet initialized, the map builder class can be registered
// now and then it will be loaded when Propel initializes.
require_once 'classes/model/map/DashboardDasIndMapBuilder.php';
Propel::registerMapBuilder('classes.model.map.DashboardDasIndMapBuilder');
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,835 @@
<?php
require_once 'propel/util/BasePeer.php';
// The object class -- needed for instanceof checks in this class.
// actual class may be a subclass -- as returned by DashboardIndicatorPeer::getOMClass()
include_once 'classes/model/DashboardIndicator.php';
/**
* Base static class for performing query and update operations on the 'DASHBOARD_INDICATOR' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BaseDashboardIndicatorPeer
{
/** the default database name for this class */
const DATABASE_NAME = 'workflow';
/** the table name for this class */
const TABLE_NAME = 'DASHBOARD_INDICATOR';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'classes.model.DashboardIndicator';
/** The total number of columns. */
const NUM_COLUMNS = 14;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the DAS_IND_UID field */
const DAS_IND_UID = 'DASHBOARD_INDICATOR.DAS_IND_UID';
/** the column name for the DAS_UID field */
const DAS_UID = 'DASHBOARD_INDICATOR.DAS_UID';
/** the column name for the DAS_IND_TYPE field */
const DAS_IND_TYPE = 'DASHBOARD_INDICATOR.DAS_IND_TYPE';
/** the column name for the DAS_IND_TITLE field */
const DAS_IND_TITLE = 'DASHBOARD_INDICATOR.DAS_IND_TITLE';
/** the column name for the DAS_IND_GOAL field */
const DAS_IND_GOAL = 'DASHBOARD_INDICATOR.DAS_IND_GOAL';
/** the column name for the DAS_IND_DIRECTION field */
const DAS_IND_DIRECTION = 'DASHBOARD_INDICATOR.DAS_IND_DIRECTION';
/** the column name for the DAS_UID_PROCESS field */
const DAS_UID_PROCESS = 'DASHBOARD_INDICATOR.DAS_UID_PROCESS';
/** the column name for the DAS_IND_FIRST_FIGURE field */
const DAS_IND_FIRST_FIGURE = 'DASHBOARD_INDICATOR.DAS_IND_FIRST_FIGURE';
/** the column name for the DAS_IND_FIRST_FREQUENCY field */
const DAS_IND_FIRST_FREQUENCY = 'DASHBOARD_INDICATOR.DAS_IND_FIRST_FREQUENCY';
/** the column name for the DAS_IND_SECOND_FIGURE field */
const DAS_IND_SECOND_FIGURE = 'DASHBOARD_INDICATOR.DAS_IND_SECOND_FIGURE';
/** the column name for the DAS_IND_SECOND_FREQUENCY field */
const DAS_IND_SECOND_FREQUENCY = 'DASHBOARD_INDICATOR.DAS_IND_SECOND_FREQUENCY';
/** the column name for the DAS_IND_CREATE_DATE field */
const DAS_IND_CREATE_DATE = 'DASHBOARD_INDICATOR.DAS_IND_CREATE_DATE';
/** the column name for the DAS_IND_UPDATE_DATE field */
const DAS_IND_UPDATE_DATE = 'DASHBOARD_INDICATOR.DAS_IND_UPDATE_DATE';
/** the column name for the DAS_IND_STATUS field */
const DAS_IND_STATUS = 'DASHBOARD_INDICATOR.DAS_IND_STATUS';
/** The PHP to DB Name Mapping */
private static $phpNameMap = null;
/**
* holds an array of fieldnames
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DasIndUid', 'DasUid', 'DasIndType', 'DasIndTitle', 'DasIndGoal', 'DasIndDirection', 'DasUidProcess', 'DasIndFirstFigure', 'DasIndFirstFrequency', 'DasIndSecondFigure', 'DasIndSecondFrequency', 'DasIndCreateDate', 'DasIndUpdateDate', 'DasIndStatus', ),
BasePeer::TYPE_COLNAME => array (DashboardIndicatorPeer::DAS_IND_UID, DashboardIndicatorPeer::DAS_UID, DashboardIndicatorPeer::DAS_IND_TYPE, DashboardIndicatorPeer::DAS_IND_TITLE, DashboardIndicatorPeer::DAS_IND_GOAL, DashboardIndicatorPeer::DAS_IND_DIRECTION, DashboardIndicatorPeer::DAS_UID_PROCESS, DashboardIndicatorPeer::DAS_IND_FIRST_FIGURE, DashboardIndicatorPeer::DAS_IND_FIRST_FREQUENCY, DashboardIndicatorPeer::DAS_IND_SECOND_FIGURE, DashboardIndicatorPeer::DAS_IND_SECOND_FREQUENCY, DashboardIndicatorPeer::DAS_IND_CREATE_DATE, DashboardIndicatorPeer::DAS_IND_UPDATE_DATE, DashboardIndicatorPeer::DAS_IND_STATUS, ),
BasePeer::TYPE_FIELDNAME => array ('DAS_IND_UID', 'DAS_UID', 'DAS_IND_TYPE', 'DAS_IND_TITLE', 'DAS_IND_GOAL', 'DAS_IND_DIRECTION', 'DAS_UID_PROCESS', 'DAS_IND_FIRST_FIGURE', 'DAS_IND_FIRST_FREQUENCY', 'DAS_IND_SECOND_FIGURE', 'DAS_IND_SECOND_FREQUENCY', 'DAS_IND_CREATE_DATE', 'DAS_IND_UPDATE_DATE', 'DAS_IND_STATUS', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
);
/**
* holds an array of keys for quick access to the fieldnames array
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DasIndUid' => 0, 'DasUid' => 1, 'DasIndType' => 2, 'DasIndTitle' => 3, 'DasIndGoal' => 4, 'DasIndDirection' => 5, 'DasUidProcess' => 6, 'DasIndFirstFigure' => 7, 'DasIndFirstFrequency' => 8, 'DasIndSecondFigure' => 9, 'DasIndSecondFrequency' => 10, 'DasIndCreateDate' => 11, 'DasIndUpdateDate' => 12, 'DasIndStatus' => 13, ),
BasePeer::TYPE_COLNAME => array (DashboardIndicatorPeer::DAS_IND_UID => 0, DashboardIndicatorPeer::DAS_UID => 1, DashboardIndicatorPeer::DAS_IND_TYPE => 2, DashboardIndicatorPeer::DAS_IND_TITLE => 3, DashboardIndicatorPeer::DAS_IND_GOAL => 4, DashboardIndicatorPeer::DAS_IND_DIRECTION => 5, DashboardIndicatorPeer::DAS_UID_PROCESS => 6, DashboardIndicatorPeer::DAS_IND_FIRST_FIGURE => 7, DashboardIndicatorPeer::DAS_IND_FIRST_FREQUENCY => 8, DashboardIndicatorPeer::DAS_IND_SECOND_FIGURE => 9, DashboardIndicatorPeer::DAS_IND_SECOND_FREQUENCY => 10, DashboardIndicatorPeer::DAS_IND_CREATE_DATE => 11, DashboardIndicatorPeer::DAS_IND_UPDATE_DATE => 12, DashboardIndicatorPeer::DAS_IND_STATUS => 13, ),
BasePeer::TYPE_FIELDNAME => array ('DAS_IND_UID' => 0, 'DAS_UID' => 1, 'DAS_IND_TYPE' => 2, 'DAS_IND_TITLE' => 3, 'DAS_IND_GOAL' => 4, 'DAS_IND_DIRECTION' => 5, 'DAS_UID_PROCESS' => 6, 'DAS_IND_FIRST_FIGURE' => 7, 'DAS_IND_FIRST_FREQUENCY' => 8, 'DAS_IND_SECOND_FIGURE' => 9, 'DAS_IND_SECOND_FREQUENCY' => 10, 'DAS_IND_CREATE_DATE' => 11, 'DAS_IND_UPDATE_DATE' => 12, 'DAS_IND_STATUS' => 13, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
);
/**
* @return MapBuilder the map builder for this peer
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getMapBuilder()
{
include_once 'classes/model/map/DashboardIndicatorMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.DashboardIndicatorMapBuilder');
}
/**
* Gets a map (hash) of PHP names to DB column names.
*
* @return array The PHP to DB name map for this peer
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
*/
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = DashboardIndicatorPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
/**
* Translates a fieldname to another type
*
* @param string $name field name
* @param string $fromType One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @param string $toType One of the class type constants
* @return string translated name of the field.
*/
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
/**
* Returns an array of of field names.
*
* @param string $type The type of fieldnames to return:
* One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @return array A list of field names
*/
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
/**
* Convenience method which changes table.column to alias.column.
*
* Using this method you can maintain SQL abstraction while using column aliases.
* <code>
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
* </code>
* @param string $alias The alias for the current table.
* @param string $column The column name for current table. (i.e. DashboardIndicatorPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(DashboardIndicatorPeer::TABLE_NAME.'.', $alias.'.', $column);
}
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param criteria object containing the columns to add.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_UID);
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_UID);
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_TYPE);
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_TITLE);
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_GOAL);
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_DIRECTION);
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_UID_PROCESS);
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_FIRST_FIGURE);
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_FIRST_FREQUENCY);
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_SECOND_FIGURE);
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_SECOND_FREQUENCY);
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_CREATE_DATE);
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_UPDATE_DATE);
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_STATUS);
}
const COUNT = 'COUNT(DASHBOARD_INDICATOR.DAS_IND_UID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT DASHBOARD_INDICATOR.DAS_IND_UID)';
/**
* Returns the number of rows matching criteria.
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
* @param Connection $con
* @return int Number of matching rows.
*/
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// clear out anything that might confuse the ORDER BY clause
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(DashboardIndicatorPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(DashboardIndicatorPeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach ($criteria->getGroupByColumns() as $column) {
$criteria->addSelectColumn($column);
}
$rs = DashboardIndicatorPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
// no rows returned; we infer that means 0 matches.
return 0;
}
}
/**
* Method to select one object from the DB.
*
* @param Criteria $criteria object used to create the SELECT statement.
* @param Connection $con
* @return DashboardIndicator
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = DashboardIndicatorPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
/**
* Method to do selects.
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con
* @return array Array of selected Objects
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelect(Criteria $criteria, $con = null)
{
return DashboardIndicatorPeer::populateObjects(DashboardIndicatorPeer::doSelectRS($criteria, $con));
}
/**
* Prepares the Criteria object and uses the parent doSelect()
* method to get a ResultSet.
*
* Use this method directly if you want to just get the resultset
* (instead of an array of objects).
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return ResultSet The resultset object with numerically-indexed fields.
* @see BasePeer::doSelect()
*/
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
DashboardIndicatorPeer::addSelectColumns($criteria);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
// BasePeer returns a Creole ResultSet, set to return
// rows indexed numerically.
return BasePeer::doSelect($criteria, $con);
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(ResultSet $rs)
{
$results = array();
// set the class once to avoid overhead in the loop
$cls = DashboardIndicatorPeer::getOMClass();
$cls = Propel::import($cls);
// populate the object(s)
while ($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
/**
* Returns the number of rows matching criteria, joining the related Dashboard table
*
* @param Criteria $c
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
* @param Connection $con
* @return int Number of matching rows.
*/
public static function doCountJoinDashboard(Criteria $criteria, $distinct = false, $con = null)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// clear out anything that might confuse the ORDER BY clause
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(DashboardIndicatorPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(DashboardIndicatorPeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(DashboardIndicatorPeer::DAS_UID, DashboardPeer::DAS_UID);
$rs = DashboardIndicatorPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
// no rows returned; we infer that means 0 matches.
return 0;
}
}
/**
* Selects a collection of DashboardIndicator objects pre-filled with their Dashboard objects.
*
* @return array Array of DashboardIndicator objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinDashboard(Criteria $c, $con = null)
{
$c = clone $c;
// Set the correct dbName if it has not been overridden
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
DashboardIndicatorPeer::addSelectColumns($c);
$startcol = (DashboardIndicatorPeer::NUM_COLUMNS - DashboardIndicatorPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
DashboardPeer::addSelectColumns($c);
$c->addJoin(DashboardIndicatorPeer::DAS_UID, DashboardPeer::DAS_UID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = DashboardIndicatorPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = DashboardPeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$newObject = true;
foreach($results as $temp_obj1) {
$temp_obj2 = $temp_obj1->getDashboard(); //CHECKME
if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
// e.g. $author->addBookRelatedByBookId()
$temp_obj2->addDashboardIndicator($obj1); //CHECKME
break;
}
}
if ($newObject) {
$obj2->initDashboardIndicators();
$obj2->addDashboardIndicator($obj1); //CHECKME
}
$results[] = $obj1;
}
return $results;
}
/**
* Returns the number of rows matching criteria, joining all related tables
*
* @param Criteria $c
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
* @param Connection $con
* @return int Number of matching rows.
*/
public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
// clear out anything that might confuse the ORDER BY clause
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(DashboardIndicatorPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(DashboardIndicatorPeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(DashboardIndicatorPeer::DAS_UID, DashboardPeer::DAS_UID);
$rs = DashboardIndicatorPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
// no rows returned; we infer that means 0 matches.
return 0;
}
}
/**
* Selects a collection of DashboardIndicator objects pre-filled with all related objects.
*
* @return array Array of DashboardIndicator objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAll(Criteria $c, $con = null)
{
$c = clone $c;
// Set the correct dbName if it has not been overridden
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
DashboardIndicatorPeer::addSelectColumns($c);
$startcol2 = (DashboardIndicatorPeer::NUM_COLUMNS - DashboardIndicatorPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
DashboardPeer::addSelectColumns($c);
$startcol3 = $startcol2 + DashboardPeer::NUM_COLUMNS;
$c->addJoin(DashboardIndicatorPeer::DAS_UID, DashboardPeer::DAS_UID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = DashboardIndicatorPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
// Add objects for joined Dashboard rows
$omClass = DashboardPeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol2);
$newObject = true;
for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
$temp_obj1 = $results[$j];
$temp_obj2 = $temp_obj1->getDashboard(); // CHECKME
if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addDashboardIndicator($obj1); // CHECKME
break;
}
}
if ($newObject) {
$obj2->initDashboardIndicators();
$obj2->addDashboardIndicator($obj1);
}
$results[] = $obj1;
}
return $results;
}
/**
* Returns the TableMap related to this peer.
* This method is not needed for general use but a specific application could have a need.
* @return TableMap
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
/**
* The class that the Peer will make instances of.
*
* This uses a dot-path notation which is tranalted into a path
* relative to a location on the PHP include_path.
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
*
* @return string path.to.ClassName
*/
public static function getOMClass()
{
return DashboardIndicatorPeer::CLASS_DEFAULT;
}
/**
* Method perform an INSERT on the database, given a DashboardIndicator or Criteria object.
*
* @param mixed $values Criteria or DashboardIndicator object containing data that is used to create the INSERT statement.
* @param Connection $con the connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from DashboardIndicator object
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
try {
// use transaction because $criteria could contain info
// for more than one table (I guess, conceivably)
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
/**
* Method perform an UPDATE on the database, given a DashboardIndicator or Criteria object.
*
* @param mixed $values Criteria or DashboardIndicator object containing data create the UPDATE statement.
* @param Connection $con The connection to use (specify Connection exert more control over transactions).
* @return int The number of affected rows (if supported by underlying database driver).
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(DashboardIndicatorPeer::DAS_IND_UID);
$selectCriteria->add(DashboardIndicatorPeer::DAS_IND_UID, $criteria->remove(DashboardIndicatorPeer::DAS_IND_UID), $comparison);
} else {
$criteria = $values->buildCriteria(); // gets full criteria
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
}
// set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
/**
* Method to DELETE all rows from the DASHBOARD_INDICATOR table.
*
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDeleteAll(DashboardIndicatorPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a DashboardIndicator or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or DashboardIndicator object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param Connection $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
* This includes CASCADE-related rows
* if supported by native driver or if emulated using Propel.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(DashboardIndicatorPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} elseif ($values instanceof DashboardIndicator) {
$criteria = $values->buildPkeyCriteria();
} else {
// it must be the primary key
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(DashboardIndicatorPeer::DAS_IND_UID, (array) $values, Criteria::IN);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Validates all modified columns of given DashboardIndicator object.
* If parameter $columns is either a single column name or an array of column names
* than only those columns are validated.
*
* NOTICE: This does not apply to primary or foreign keys for now.
*
* @param DashboardIndicator $obj The object to validate.
* @param mixed $cols Column name or array of column names.
*
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
*/
public static function doValidate(DashboardIndicator $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(DashboardIndicatorPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(DashboardIndicatorPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach ($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
return BasePeer::doValidate(DashboardIndicatorPeer::DATABASE_NAME, DashboardIndicatorPeer::TABLE_NAME, $columns);
}
/**
* Retrieve a single object by pkey.
*
* @param mixed $pk the primary key.
* @param Connection $con the connection to use
* @return DashboardIndicator
*/
public static function retrieveByPK($pk, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(DashboardIndicatorPeer::DATABASE_NAME);
$criteria->add(DashboardIndicatorPeer::DAS_IND_UID, $pk);
$v = DashboardIndicatorPeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
/**
* Retrieve multiple objects by pkey.
*
* @param array $pks List of primary keys
* @param Connection $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function retrieveByPKs($pks, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(DashboardIndicatorPeer::DAS_IND_UID, $pks, Criteria::IN);
$objs = DashboardIndicatorPeer::doSelect($criteria, $con);
}
return $objs;
}
}
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
// the MapBuilder classes register themselves with Propel during initialization
// so we need to load them here.
try {
BaseDashboardIndicatorPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
// even if Propel is not yet initialized, the map builder class can be registered
// now and then it will be loaded when Propel initializes.
require_once 'classes/model/map/DashboardIndicatorMapBuilder.php';
Propel::registerMapBuilder('classes.model.map.DashboardIndicatorMapBuilder');
}

View File

@@ -0,0 +1,592 @@
<?php
require_once 'propel/util/BasePeer.php';
// The object class -- needed for instanceof checks in this class.
// actual class may be a subclass -- as returned by DashboardPeer::getOMClass()
include_once 'classes/model/Dashboard.php';
/**
* Base static class for performing query and update operations on the 'DASHBOARD' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BaseDashboardPeer
{
/** the default database name for this class */
const DATABASE_NAME = 'workflow';
/** the table name for this class */
const TABLE_NAME = 'DASHBOARD';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'classes.model.Dashboard';
/** The total number of columns. */
const NUM_COLUMNS = 6;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the DAS_UID field */
const DAS_UID = 'DASHBOARD.DAS_UID';
/** the column name for the DAS_TITLE field */
const DAS_TITLE = 'DASHBOARD.DAS_TITLE';
/** the column name for the DAS_DESCRIPTION field */
const DAS_DESCRIPTION = 'DASHBOARD.DAS_DESCRIPTION';
/** the column name for the DAS_CREATE_DATE field */
const DAS_CREATE_DATE = 'DASHBOARD.DAS_CREATE_DATE';
/** the column name for the DAS_UPDATE_DATE field */
const DAS_UPDATE_DATE = 'DASHBOARD.DAS_UPDATE_DATE';
/** the column name for the DAS_STATUS field */
const DAS_STATUS = 'DASHBOARD.DAS_STATUS';
/** The PHP to DB Name Mapping */
private static $phpNameMap = null;
/**
* holds an array of fieldnames
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DasUid', 'DasTitle', 'DasDescription', 'DasCreateDate', 'DasUpdateDate', 'DasStatus', ),
BasePeer::TYPE_COLNAME => array (DashboardPeer::DAS_UID, DashboardPeer::DAS_TITLE, DashboardPeer::DAS_DESCRIPTION, DashboardPeer::DAS_CREATE_DATE, DashboardPeer::DAS_UPDATE_DATE, DashboardPeer::DAS_STATUS, ),
BasePeer::TYPE_FIELDNAME => array ('DAS_UID', 'DAS_TITLE', 'DAS_DESCRIPTION', 'DAS_CREATE_DATE', 'DAS_UPDATE_DATE', 'DAS_STATUS', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
);
/**
* holds an array of keys for quick access to the fieldnames array
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DasUid' => 0, 'DasTitle' => 1, 'DasDescription' => 2, 'DasCreateDate' => 3, 'DasUpdateDate' => 4, 'DasStatus' => 5, ),
BasePeer::TYPE_COLNAME => array (DashboardPeer::DAS_UID => 0, DashboardPeer::DAS_TITLE => 1, DashboardPeer::DAS_DESCRIPTION => 2, DashboardPeer::DAS_CREATE_DATE => 3, DashboardPeer::DAS_UPDATE_DATE => 4, DashboardPeer::DAS_STATUS => 5, ),
BasePeer::TYPE_FIELDNAME => array ('DAS_UID' => 0, 'DAS_TITLE' => 1, 'DAS_DESCRIPTION' => 2, 'DAS_CREATE_DATE' => 3, 'DAS_UPDATE_DATE' => 4, 'DAS_STATUS' => 5, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
);
/**
* @return MapBuilder the map builder for this peer
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getMapBuilder()
{
include_once 'classes/model/map/DashboardMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.DashboardMapBuilder');
}
/**
* Gets a map (hash) of PHP names to DB column names.
*
* @return array The PHP to DB name map for this peer
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
*/
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = DashboardPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
/**
* Translates a fieldname to another type
*
* @param string $name field name
* @param string $fromType One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @param string $toType One of the class type constants
* @return string translated name of the field.
*/
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
/**
* Returns an array of of field names.
*
* @param string $type The type of fieldnames to return:
* One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @return array A list of field names
*/
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
/**
* Convenience method which changes table.column to alias.column.
*
* Using this method you can maintain SQL abstraction while using column aliases.
* <code>
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
* </code>
* @param string $alias The alias for the current table.
* @param string $column The column name for current table. (i.e. DashboardPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(DashboardPeer::TABLE_NAME.'.', $alias.'.', $column);
}
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param criteria object containing the columns to add.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(DashboardPeer::DAS_UID);
$criteria->addSelectColumn(DashboardPeer::DAS_TITLE);
$criteria->addSelectColumn(DashboardPeer::DAS_DESCRIPTION);
$criteria->addSelectColumn(DashboardPeer::DAS_CREATE_DATE);
$criteria->addSelectColumn(DashboardPeer::DAS_UPDATE_DATE);
$criteria->addSelectColumn(DashboardPeer::DAS_STATUS);
}
const COUNT = 'COUNT(DASHBOARD.DAS_UID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT DASHBOARD.DAS_UID)';
/**
* Returns the number of rows matching criteria.
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
* @param Connection $con
* @return int Number of matching rows.
*/
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// clear out anything that might confuse the ORDER BY clause
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(DashboardPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(DashboardPeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach ($criteria->getGroupByColumns() as $column) {
$criteria->addSelectColumn($column);
}
$rs = DashboardPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
// no rows returned; we infer that means 0 matches.
return 0;
}
}
/**
* Method to select one object from the DB.
*
* @param Criteria $criteria object used to create the SELECT statement.
* @param Connection $con
* @return Dashboard
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = DashboardPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
/**
* Method to do selects.
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con
* @return array Array of selected Objects
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelect(Criteria $criteria, $con = null)
{
return DashboardPeer::populateObjects(DashboardPeer::doSelectRS($criteria, $con));
}
/**
* Prepares the Criteria object and uses the parent doSelect()
* method to get a ResultSet.
*
* Use this method directly if you want to just get the resultset
* (instead of an array of objects).
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return ResultSet The resultset object with numerically-indexed fields.
* @see BasePeer::doSelect()
*/
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
DashboardPeer::addSelectColumns($criteria);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
// BasePeer returns a Creole ResultSet, set to return
// rows indexed numerically.
return BasePeer::doSelect($criteria, $con);
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(ResultSet $rs)
{
$results = array();
// set the class once to avoid overhead in the loop
$cls = DashboardPeer::getOMClass();
$cls = Propel::import($cls);
// populate the object(s)
while ($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
/**
* Returns the TableMap related to this peer.
* This method is not needed for general use but a specific application could have a need.
* @return TableMap
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
/**
* The class that the Peer will make instances of.
*
* This uses a dot-path notation which is tranalted into a path
* relative to a location on the PHP include_path.
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
*
* @return string path.to.ClassName
*/
public static function getOMClass()
{
return DashboardPeer::CLASS_DEFAULT;
}
/**
* Method perform an INSERT on the database, given a Dashboard or Criteria object.
*
* @param mixed $values Criteria or Dashboard object containing data that is used to create the INSERT statement.
* @param Connection $con the connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from Dashboard object
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
try {
// use transaction because $criteria could contain info
// for more than one table (I guess, conceivably)
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
/**
* Method perform an UPDATE on the database, given a Dashboard or Criteria object.
*
* @param mixed $values Criteria or Dashboard object containing data create the UPDATE statement.
* @param Connection $con The connection to use (specify Connection exert more control over transactions).
* @return int The number of affected rows (if supported by underlying database driver).
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(DashboardPeer::DAS_UID);
$selectCriteria->add(DashboardPeer::DAS_UID, $criteria->remove(DashboardPeer::DAS_UID), $comparison);
} else {
$criteria = $values->buildCriteria(); // gets full criteria
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
}
// set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
/**
* Method to DELETE all rows from the DASHBOARD table.
*
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDeleteAll(DashboardPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a Dashboard or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or Dashboard object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param Connection $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
* This includes CASCADE-related rows
* if supported by native driver or if emulated using Propel.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(DashboardPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} elseif ($values instanceof Dashboard) {
$criteria = $values->buildPkeyCriteria();
} else {
// it must be the primary key
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(DashboardPeer::DAS_UID, (array) $values, Criteria::IN);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Validates all modified columns of given Dashboard object.
* If parameter $columns is either a single column name or an array of column names
* than only those columns are validated.
*
* NOTICE: This does not apply to primary or foreign keys for now.
*
* @param Dashboard $obj The object to validate.
* @param mixed $cols Column name or array of column names.
*
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
*/
public static function doValidate(Dashboard $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(DashboardPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(DashboardPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach ($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
return BasePeer::doValidate(DashboardPeer::DATABASE_NAME, DashboardPeer::TABLE_NAME, $columns);
}
/**
* Retrieve a single object by pkey.
*
* @param mixed $pk the primary key.
* @param Connection $con the connection to use
* @return Dashboard
*/
public static function retrieveByPK($pk, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(DashboardPeer::DATABASE_NAME);
$criteria->add(DashboardPeer::DAS_UID, $pk);
$v = DashboardPeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
/**
* Retrieve multiple objects by pkey.
*
* @param array $pks List of primary keys
* @param Connection $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function retrieveByPKs($pks, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(DashboardPeer::DAS_UID, $pks, Criteria::IN);
$objs = DashboardPeer::doSelect($criteria, $con);
}
return $objs;
}
}
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
// the MapBuilder classes register themselves with Propel during initialization
// so we need to load them here.
try {
BaseDashboardPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
// even if Propel is not yet initialized, the map builder class can be registered
// now and then it will be loaded when Propel initializes.
require_once 'classes/model/map/DashboardMapBuilder.php';
Propel::registerMapBuilder('classes.model.map.DashboardMapBuilder');
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,619 @@
<?php
require_once 'propel/util/BasePeer.php';
// The object class -- needed for instanceof checks in this class.
// actual class may be a subclass -- as returned by ProReportingPeer::getOMClass()
include_once 'classes/model/ProReporting.php';
/**
* Base static class for performing query and update operations on the 'PRO_REPORTING' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BaseProReportingPeer
{
/** the default database name for this class */
const DATABASE_NAME = 'workflow';
/** the table name for this class */
const TABLE_NAME = 'PRO_REPORTING';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'classes.model.ProReporting';
/** The total number of columns. */
const NUM_COLUMNS = 12;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the PRO_UID field */
const PRO_UID = 'PRO_REPORTING.PRO_UID';
/** the column name for the MONTH field */
const MONTH = 'PRO_REPORTING.MONTH';
/** the column name for the YEAR field */
const YEAR = 'PRO_REPORTING.YEAR';
/** the column name for the AVG_TIME field */
const AVG_TIME = 'PRO_REPORTING.AVG_TIME';
/** the column name for the SDV_TIME field */
const SDV_TIME = 'PRO_REPORTING.SDV_TIME';
/** the column name for the TOTAL_CASES_IN field */
const TOTAL_CASES_IN = 'PRO_REPORTING.TOTAL_CASES_IN';
/** the column name for the TOTAL_CASES_OUT field */
const TOTAL_CASES_OUT = 'PRO_REPORTING.TOTAL_CASES_OUT';
/** the column name for the CONFIGURED_PROCESS_TIME field */
const CONFIGURED_PROCESS_TIME = 'PRO_REPORTING.CONFIGURED_PROCESS_TIME';
/** the column name for the CONFIGURED_PROCESS_COST field */
const CONFIGURED_PROCESS_COST = 'PRO_REPORTING.CONFIGURED_PROCESS_COST';
/** the column name for the TOTAL_CASES_OPEN field */
const TOTAL_CASES_OPEN = 'PRO_REPORTING.TOTAL_CASES_OPEN';
/** the column name for the TOTAL_CASES_OVERDUE field */
const TOTAL_CASES_OVERDUE = 'PRO_REPORTING.TOTAL_CASES_OVERDUE';
/** the column name for the TOTAL_CASES_ON_TIME field */
const TOTAL_CASES_ON_TIME = 'PRO_REPORTING.TOTAL_CASES_ON_TIME';
/** The PHP to DB Name Mapping */
private static $phpNameMap = null;
/**
* holds an array of fieldnames
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('ProUid', 'Month', 'Year', 'AvgTime', 'SdvTime', 'TotalCasesIn', 'TotalCasesOut', 'ConfiguredProcessTime', 'ConfiguredProcessCost', 'TotalCasesOpen', 'TotalCasesOverdue', 'TotalCasesOnTime', ),
BasePeer::TYPE_COLNAME => array (ProReportingPeer::PRO_UID, ProReportingPeer::MONTH, ProReportingPeer::YEAR, ProReportingPeer::AVG_TIME, ProReportingPeer::SDV_TIME, ProReportingPeer::TOTAL_CASES_IN, ProReportingPeer::TOTAL_CASES_OUT, ProReportingPeer::CONFIGURED_PROCESS_TIME, ProReportingPeer::CONFIGURED_PROCESS_COST, ProReportingPeer::TOTAL_CASES_OPEN, ProReportingPeer::TOTAL_CASES_OVERDUE, ProReportingPeer::TOTAL_CASES_ON_TIME, ),
BasePeer::TYPE_FIELDNAME => array ('PRO_UID', 'MONTH', 'YEAR', 'AVG_TIME', 'SDV_TIME', 'TOTAL_CASES_IN', 'TOTAL_CASES_OUT', 'CONFIGURED_PROCESS_TIME', 'CONFIGURED_PROCESS_COST', 'TOTAL_CASES_OPEN', 'TOTAL_CASES_OVERDUE', 'TOTAL_CASES_ON_TIME', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
);
/**
* holds an array of keys for quick access to the fieldnames array
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('ProUid' => 0, 'Month' => 1, 'Year' => 2, 'AvgTime' => 3, 'SdvTime' => 4, 'TotalCasesIn' => 5, 'TotalCasesOut' => 6, 'ConfiguredProcessTime' => 7, 'ConfiguredProcessCost' => 8, 'TotalCasesOpen' => 9, 'TotalCasesOverdue' => 10, 'TotalCasesOnTime' => 11, ),
BasePeer::TYPE_COLNAME => array (ProReportingPeer::PRO_UID => 0, ProReportingPeer::MONTH => 1, ProReportingPeer::YEAR => 2, ProReportingPeer::AVG_TIME => 3, ProReportingPeer::SDV_TIME => 4, ProReportingPeer::TOTAL_CASES_IN => 5, ProReportingPeer::TOTAL_CASES_OUT => 6, ProReportingPeer::CONFIGURED_PROCESS_TIME => 7, ProReportingPeer::CONFIGURED_PROCESS_COST => 8, ProReportingPeer::TOTAL_CASES_OPEN => 9, ProReportingPeer::TOTAL_CASES_OVERDUE => 10, ProReportingPeer::TOTAL_CASES_ON_TIME => 11, ),
BasePeer::TYPE_FIELDNAME => array ('PRO_UID' => 0, 'MONTH' => 1, 'YEAR' => 2, 'AVG_TIME' => 3, 'SDV_TIME' => 4, 'TOTAL_CASES_IN' => 5, 'TOTAL_CASES_OUT' => 6, 'CONFIGURED_PROCESS_TIME' => 7, 'CONFIGURED_PROCESS_COST' => 8, 'TOTAL_CASES_OPEN' => 9, 'TOTAL_CASES_OVERDUE' => 10, 'TOTAL_CASES_ON_TIME' => 11, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
);
/**
* @return MapBuilder the map builder for this peer
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getMapBuilder()
{
include_once 'classes/model/map/ProReportingMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.ProReportingMapBuilder');
}
/**
* Gets a map (hash) of PHP names to DB column names.
*
* @return array The PHP to DB name map for this peer
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
*/
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = ProReportingPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
/**
* Translates a fieldname to another type
*
* @param string $name field name
* @param string $fromType One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @param string $toType One of the class type constants
* @return string translated name of the field.
*/
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
/**
* Returns an array of of field names.
*
* @param string $type The type of fieldnames to return:
* One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @return array A list of field names
*/
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
/**
* Convenience method which changes table.column to alias.column.
*
* Using this method you can maintain SQL abstraction while using column aliases.
* <code>
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
* </code>
* @param string $alias The alias for the current table.
* @param string $column The column name for current table. (i.e. ProReportingPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(ProReportingPeer::TABLE_NAME.'.', $alias.'.', $column);
}
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param criteria object containing the columns to add.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(ProReportingPeer::PRO_UID);
$criteria->addSelectColumn(ProReportingPeer::MONTH);
$criteria->addSelectColumn(ProReportingPeer::YEAR);
$criteria->addSelectColumn(ProReportingPeer::AVG_TIME);
$criteria->addSelectColumn(ProReportingPeer::SDV_TIME);
$criteria->addSelectColumn(ProReportingPeer::TOTAL_CASES_IN);
$criteria->addSelectColumn(ProReportingPeer::TOTAL_CASES_OUT);
$criteria->addSelectColumn(ProReportingPeer::CONFIGURED_PROCESS_TIME);
$criteria->addSelectColumn(ProReportingPeer::CONFIGURED_PROCESS_COST);
$criteria->addSelectColumn(ProReportingPeer::TOTAL_CASES_OPEN);
$criteria->addSelectColumn(ProReportingPeer::TOTAL_CASES_OVERDUE);
$criteria->addSelectColumn(ProReportingPeer::TOTAL_CASES_ON_TIME);
}
const COUNT = 'COUNT(PRO_REPORTING.PRO_UID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT PRO_REPORTING.PRO_UID)';
/**
* Returns the number of rows matching criteria.
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
* @param Connection $con
* @return int Number of matching rows.
*/
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// clear out anything that might confuse the ORDER BY clause
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(ProReportingPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(ProReportingPeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach ($criteria->getGroupByColumns() as $column) {
$criteria->addSelectColumn($column);
}
$rs = ProReportingPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
// no rows returned; we infer that means 0 matches.
return 0;
}
}
/**
* Method to select one object from the DB.
*
* @param Criteria $criteria object used to create the SELECT statement.
* @param Connection $con
* @return ProReporting
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = ProReportingPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
/**
* Method to do selects.
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con
* @return array Array of selected Objects
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelect(Criteria $criteria, $con = null)
{
return ProReportingPeer::populateObjects(ProReportingPeer::doSelectRS($criteria, $con));
}
/**
* Prepares the Criteria object and uses the parent doSelect()
* method to get a ResultSet.
*
* Use this method directly if you want to just get the resultset
* (instead of an array of objects).
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return ResultSet The resultset object with numerically-indexed fields.
* @see BasePeer::doSelect()
*/
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
ProReportingPeer::addSelectColumns($criteria);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
// BasePeer returns a Creole ResultSet, set to return
// rows indexed numerically.
return BasePeer::doSelect($criteria, $con);
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(ResultSet $rs)
{
$results = array();
// set the class once to avoid overhead in the loop
$cls = ProReportingPeer::getOMClass();
$cls = Propel::import($cls);
// populate the object(s)
while ($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
/**
* Returns the TableMap related to this peer.
* This method is not needed for general use but a specific application could have a need.
* @return TableMap
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
/**
* The class that the Peer will make instances of.
*
* This uses a dot-path notation which is tranalted into a path
* relative to a location on the PHP include_path.
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
*
* @return string path.to.ClassName
*/
public static function getOMClass()
{
return ProReportingPeer::CLASS_DEFAULT;
}
/**
* Method perform an INSERT on the database, given a ProReporting or Criteria object.
*
* @param mixed $values Criteria or ProReporting object containing data that is used to create the INSERT statement.
* @param Connection $con the connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from ProReporting object
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
try {
// use transaction because $criteria could contain info
// for more than one table (I guess, conceivably)
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
/**
* Method perform an UPDATE on the database, given a ProReporting or Criteria object.
*
* @param mixed $values Criteria or ProReporting object containing data create the UPDATE statement.
* @param Connection $con The connection to use (specify Connection exert more control over transactions).
* @return int The number of affected rows (if supported by underlying database driver).
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(ProReportingPeer::PRO_UID);
$selectCriteria->add(ProReportingPeer::PRO_UID, $criteria->remove(ProReportingPeer::PRO_UID), $comparison);
$comparison = $criteria->getComparison(ProReportingPeer::MONTH);
$selectCriteria->add(ProReportingPeer::MONTH, $criteria->remove(ProReportingPeer::MONTH), $comparison);
$comparison = $criteria->getComparison(ProReportingPeer::YEAR);
$selectCriteria->add(ProReportingPeer::YEAR, $criteria->remove(ProReportingPeer::YEAR), $comparison);
} else {
$criteria = $values->buildCriteria(); // gets full criteria
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
}
// set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
/**
* Method to DELETE all rows from the PRO_REPORTING table.
*
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDeleteAll(ProReportingPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a ProReporting or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ProReporting object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param Connection $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
* This includes CASCADE-related rows
* if supported by native driver or if emulated using Propel.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(ProReportingPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} elseif ($values instanceof ProReporting) {
$criteria = $values->buildPkeyCriteria();
} else {
// it must be the primary key
$criteria = new Criteria(self::DATABASE_NAME);
// primary key is composite; we therefore, expect
// the primary key passed to be an array of pkey
// values
if (count($values) == count($values, COUNT_RECURSIVE)) {
// array is not multi-dimensional
$values = array($values);
}
$vals = array();
foreach ($values as $value) {
$vals[0][] = $value[0];
$vals[1][] = $value[1];
$vals[2][] = $value[2];
}
$criteria->add(ProReportingPeer::PRO_UID, $vals[0], Criteria::IN);
$criteria->add(ProReportingPeer::MONTH, $vals[1], Criteria::IN);
$criteria->add(ProReportingPeer::YEAR, $vals[2], Criteria::IN);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Validates all modified columns of given ProReporting object.
* If parameter $columns is either a single column name or an array of column names
* than only those columns are validated.
*
* NOTICE: This does not apply to primary or foreign keys for now.
*
* @param ProReporting $obj The object to validate.
* @param mixed $cols Column name or array of column names.
*
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
*/
public static function doValidate(ProReporting $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(ProReportingPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(ProReportingPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach ($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
return BasePeer::doValidate(ProReportingPeer::DATABASE_NAME, ProReportingPeer::TABLE_NAME, $columns);
}
/**
* Retrieve object using using composite pkey values.
* @param string $pro_uid
* @param int $month
* @param int $year
* @param Connection $con
* @return ProReporting
*/
public static function retrieveByPK($pro_uid, $month, $year, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria();
$criteria->add(ProReportingPeer::PRO_UID, $pro_uid);
$criteria->add(ProReportingPeer::MONTH, $month);
$criteria->add(ProReportingPeer::YEAR, $year);
$v = ProReportingPeer::doSelect($criteria, $con);
return !empty($v) ? $v[0] : null;
}
}
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
// the MapBuilder classes register themselves with Propel during initialization
// so we need to load them here.
try {
BaseProReportingPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
// even if Propel is not yet initialized, the map builder class can be registered
// now and then it will be loaded when Propel initializes.
require_once 'classes/model/map/ProReportingMapBuilder.php';
Propel::registerMapBuilder('classes.model.map.ProReportingMapBuilder');
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,636 @@
<?php
require_once 'propel/util/BasePeer.php';
// The object class -- needed for instanceof checks in this class.
// actual class may be a subclass -- as returned by UsrReportingPeer::getOMClass()
include_once 'classes/model/UsrReporting.php';
/**
* Base static class for performing query and update operations on the 'USR_REPORTING' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BaseUsrReportingPeer
{
/** the default database name for this class */
const DATABASE_NAME = 'workflow';
/** the table name for this class */
const TABLE_NAME = 'USR_REPORTING';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'classes.model.UsrReporting';
/** The total number of columns. */
const NUM_COLUMNS = 14;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the USR_UID field */
const USR_UID = 'USR_REPORTING.USR_UID';
/** the column name for the TAS_UID field */
const TAS_UID = 'USR_REPORTING.TAS_UID';
/** the column name for the PRO_UID field */
const PRO_UID = 'USR_REPORTING.PRO_UID';
/** the column name for the MONTH field */
const MONTH = 'USR_REPORTING.MONTH';
/** the column name for the YEAR field */
const YEAR = 'USR_REPORTING.YEAR';
/** the column name for the TOTAL_TIME_BY_TASK field */
const TOTAL_TIME_BY_TASK = 'USR_REPORTING.TOTAL_TIME_BY_TASK';
/** the column name for the TOTAL_CASES_IN field */
const TOTAL_CASES_IN = 'USR_REPORTING.TOTAL_CASES_IN';
/** the column name for the TOTAL_CASES_OUT field */
const TOTAL_CASES_OUT = 'USR_REPORTING.TOTAL_CASES_OUT';
/** the column name for the USER_HOUR_COST field */
const USER_HOUR_COST = 'USR_REPORTING.USER_HOUR_COST';
/** the column name for the AVG_TIME field */
const AVG_TIME = 'USR_REPORTING.AVG_TIME';
/** the column name for the SDV_TIME field */
const SDV_TIME = 'USR_REPORTING.SDV_TIME';
/** the column name for the CONFIGURED_TASK_TIME field */
const CONFIGURED_TASK_TIME = 'USR_REPORTING.CONFIGURED_TASK_TIME';
/** the column name for the TOTAL_CASES_OVERDUE field */
const TOTAL_CASES_OVERDUE = 'USR_REPORTING.TOTAL_CASES_OVERDUE';
/** the column name for the TOTAL_CASES_ON_TIME field */
const TOTAL_CASES_ON_TIME = 'USR_REPORTING.TOTAL_CASES_ON_TIME';
/** The PHP to DB Name Mapping */
private static $phpNameMap = null;
/**
* holds an array of fieldnames
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('UsrUid', 'TasUid', 'ProUid', 'Month', 'Year', 'TotalTimeByTask', 'TotalCasesIn', 'TotalCasesOut', 'UserHourCost', 'AvgTime', 'SdvTime', 'ConfiguredTaskTime', 'TotalCasesOverdue', 'TotalCasesOnTime', ),
BasePeer::TYPE_COLNAME => array (UsrReportingPeer::USR_UID, UsrReportingPeer::TAS_UID, UsrReportingPeer::PRO_UID, UsrReportingPeer::MONTH, UsrReportingPeer::YEAR, UsrReportingPeer::TOTAL_TIME_BY_TASK, UsrReportingPeer::TOTAL_CASES_IN, UsrReportingPeer::TOTAL_CASES_OUT, UsrReportingPeer::USER_HOUR_COST, UsrReportingPeer::AVG_TIME, UsrReportingPeer::SDV_TIME, UsrReportingPeer::CONFIGURED_TASK_TIME, UsrReportingPeer::TOTAL_CASES_OVERDUE, UsrReportingPeer::TOTAL_CASES_ON_TIME, ),
BasePeer::TYPE_FIELDNAME => array ('USR_UID', 'TAS_UID', 'PRO_UID', 'MONTH', 'YEAR', 'TOTAL_TIME_BY_TASK', 'TOTAL_CASES_IN', 'TOTAL_CASES_OUT', 'USER_HOUR_COST', 'AVG_TIME', 'SDV_TIME', 'CONFIGURED_TASK_TIME', 'TOTAL_CASES_OVERDUE', 'TOTAL_CASES_ON_TIME', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
);
/**
* holds an array of keys for quick access to the fieldnames array
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('UsrUid' => 0, 'TasUid' => 1, 'ProUid' => 2, 'Month' => 3, 'Year' => 4, 'TotalTimeByTask' => 5, 'TotalCasesIn' => 6, 'TotalCasesOut' => 7, 'UserHourCost' => 8, 'AvgTime' => 9, 'SdvTime' => 10, 'ConfiguredTaskTime' => 11, 'TotalCasesOverdue' => 12, 'TotalCasesOnTime' => 13, ),
BasePeer::TYPE_COLNAME => array (UsrReportingPeer::USR_UID => 0, UsrReportingPeer::TAS_UID => 1, UsrReportingPeer::PRO_UID => 2, UsrReportingPeer::MONTH => 3, UsrReportingPeer::YEAR => 4, UsrReportingPeer::TOTAL_TIME_BY_TASK => 5, UsrReportingPeer::TOTAL_CASES_IN => 6, UsrReportingPeer::TOTAL_CASES_OUT => 7, UsrReportingPeer::USER_HOUR_COST => 8, UsrReportingPeer::AVG_TIME => 9, UsrReportingPeer::SDV_TIME => 10, UsrReportingPeer::CONFIGURED_TASK_TIME => 11, UsrReportingPeer::TOTAL_CASES_OVERDUE => 12, UsrReportingPeer::TOTAL_CASES_ON_TIME => 13, ),
BasePeer::TYPE_FIELDNAME => array ('USR_UID' => 0, 'TAS_UID' => 1, 'PRO_UID' => 2, 'MONTH' => 3, 'YEAR' => 4, 'TOTAL_TIME_BY_TASK' => 5, 'TOTAL_CASES_IN' => 6, 'TOTAL_CASES_OUT' => 7, 'USER_HOUR_COST' => 8, 'AVG_TIME' => 9, 'SDV_TIME' => 10, 'CONFIGURED_TASK_TIME' => 11, 'TOTAL_CASES_OVERDUE' => 12, 'TOTAL_CASES_ON_TIME' => 13, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
);
/**
* @return MapBuilder the map builder for this peer
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getMapBuilder()
{
include_once 'classes/model/map/UsrReportingMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.UsrReportingMapBuilder');
}
/**
* Gets a map (hash) of PHP names to DB column names.
*
* @return array The PHP to DB name map for this peer
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
*/
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = UsrReportingPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
/**
* Translates a fieldname to another type
*
* @param string $name field name
* @param string $fromType One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @param string $toType One of the class type constants
* @return string translated name of the field.
*/
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
/**
* Returns an array of of field names.
*
* @param string $type The type of fieldnames to return:
* One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @return array A list of field names
*/
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
/**
* Convenience method which changes table.column to alias.column.
*
* Using this method you can maintain SQL abstraction while using column aliases.
* <code>
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
* </code>
* @param string $alias The alias for the current table.
* @param string $column The column name for current table. (i.e. UsrReportingPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(UsrReportingPeer::TABLE_NAME.'.', $alias.'.', $column);
}
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param criteria object containing the columns to add.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(UsrReportingPeer::USR_UID);
$criteria->addSelectColumn(UsrReportingPeer::TAS_UID);
$criteria->addSelectColumn(UsrReportingPeer::PRO_UID);
$criteria->addSelectColumn(UsrReportingPeer::MONTH);
$criteria->addSelectColumn(UsrReportingPeer::YEAR);
$criteria->addSelectColumn(UsrReportingPeer::TOTAL_TIME_BY_TASK);
$criteria->addSelectColumn(UsrReportingPeer::TOTAL_CASES_IN);
$criteria->addSelectColumn(UsrReportingPeer::TOTAL_CASES_OUT);
$criteria->addSelectColumn(UsrReportingPeer::USER_HOUR_COST);
$criteria->addSelectColumn(UsrReportingPeer::AVG_TIME);
$criteria->addSelectColumn(UsrReportingPeer::SDV_TIME);
$criteria->addSelectColumn(UsrReportingPeer::CONFIGURED_TASK_TIME);
$criteria->addSelectColumn(UsrReportingPeer::TOTAL_CASES_OVERDUE);
$criteria->addSelectColumn(UsrReportingPeer::TOTAL_CASES_ON_TIME);
}
const COUNT = 'COUNT(USR_REPORTING.USR_UID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT USR_REPORTING.USR_UID)';
/**
* Returns the number of rows matching criteria.
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
* @param Connection $con
* @return int Number of matching rows.
*/
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// clear out anything that might confuse the ORDER BY clause
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(UsrReportingPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(UsrReportingPeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach ($criteria->getGroupByColumns() as $column) {
$criteria->addSelectColumn($column);
}
$rs = UsrReportingPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
// no rows returned; we infer that means 0 matches.
return 0;
}
}
/**
* Method to select one object from the DB.
*
* @param Criteria $criteria object used to create the SELECT statement.
* @param Connection $con
* @return UsrReporting
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = UsrReportingPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
/**
* Method to do selects.
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con
* @return array Array of selected Objects
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelect(Criteria $criteria, $con = null)
{
return UsrReportingPeer::populateObjects(UsrReportingPeer::doSelectRS($criteria, $con));
}
/**
* Prepares the Criteria object and uses the parent doSelect()
* method to get a ResultSet.
*
* Use this method directly if you want to just get the resultset
* (instead of an array of objects).
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return ResultSet The resultset object with numerically-indexed fields.
* @see BasePeer::doSelect()
*/
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
UsrReportingPeer::addSelectColumns($criteria);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
// BasePeer returns a Creole ResultSet, set to return
// rows indexed numerically.
return BasePeer::doSelect($criteria, $con);
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(ResultSet $rs)
{
$results = array();
// set the class once to avoid overhead in the loop
$cls = UsrReportingPeer::getOMClass();
$cls = Propel::import($cls);
// populate the object(s)
while ($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
/**
* Returns the TableMap related to this peer.
* This method is not needed for general use but a specific application could have a need.
* @return TableMap
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
/**
* The class that the Peer will make instances of.
*
* This uses a dot-path notation which is tranalted into a path
* relative to a location on the PHP include_path.
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
*
* @return string path.to.ClassName
*/
public static function getOMClass()
{
return UsrReportingPeer::CLASS_DEFAULT;
}
/**
* Method perform an INSERT on the database, given a UsrReporting or Criteria object.
*
* @param mixed $values Criteria or UsrReporting object containing data that is used to create the INSERT statement.
* @param Connection $con the connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from UsrReporting object
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
try {
// use transaction because $criteria could contain info
// for more than one table (I guess, conceivably)
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
/**
* Method perform an UPDATE on the database, given a UsrReporting or Criteria object.
*
* @param mixed $values Criteria or UsrReporting object containing data create the UPDATE statement.
* @param Connection $con The connection to use (specify Connection exert more control over transactions).
* @return int The number of affected rows (if supported by underlying database driver).
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(UsrReportingPeer::USR_UID);
$selectCriteria->add(UsrReportingPeer::USR_UID, $criteria->remove(UsrReportingPeer::USR_UID), $comparison);
$comparison = $criteria->getComparison(UsrReportingPeer::TAS_UID);
$selectCriteria->add(UsrReportingPeer::TAS_UID, $criteria->remove(UsrReportingPeer::TAS_UID), $comparison);
$comparison = $criteria->getComparison(UsrReportingPeer::MONTH);
$selectCriteria->add(UsrReportingPeer::MONTH, $criteria->remove(UsrReportingPeer::MONTH), $comparison);
$comparison = $criteria->getComparison(UsrReportingPeer::YEAR);
$selectCriteria->add(UsrReportingPeer::YEAR, $criteria->remove(UsrReportingPeer::YEAR), $comparison);
} else {
$criteria = $values->buildCriteria(); // gets full criteria
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
}
// set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
/**
* Method to DELETE all rows from the USR_REPORTING table.
*
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDeleteAll(UsrReportingPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a UsrReporting or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or UsrReporting object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param Connection $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
* This includes CASCADE-related rows
* if supported by native driver or if emulated using Propel.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(UsrReportingPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} elseif ($values instanceof UsrReporting) {
$criteria = $values->buildPkeyCriteria();
} else {
// it must be the primary key
$criteria = new Criteria(self::DATABASE_NAME);
// primary key is composite; we therefore, expect
// the primary key passed to be an array of pkey
// values
if (count($values) == count($values, COUNT_RECURSIVE)) {
// array is not multi-dimensional
$values = array($values);
}
$vals = array();
foreach ($values as $value) {
$vals[0][] = $value[0];
$vals[1][] = $value[1];
$vals[2][] = $value[2];
$vals[3][] = $value[3];
}
$criteria->add(UsrReportingPeer::USR_UID, $vals[0], Criteria::IN);
$criteria->add(UsrReportingPeer::TAS_UID, $vals[1], Criteria::IN);
$criteria->add(UsrReportingPeer::MONTH, $vals[2], Criteria::IN);
$criteria->add(UsrReportingPeer::YEAR, $vals[3], Criteria::IN);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Validates all modified columns of given UsrReporting object.
* If parameter $columns is either a single column name or an array of column names
* than only those columns are validated.
*
* NOTICE: This does not apply to primary or foreign keys for now.
*
* @param UsrReporting $obj The object to validate.
* @param mixed $cols Column name or array of column names.
*
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
*/
public static function doValidate(UsrReporting $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(UsrReportingPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(UsrReportingPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach ($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
return BasePeer::doValidate(UsrReportingPeer::DATABASE_NAME, UsrReportingPeer::TABLE_NAME, $columns);
}
/**
* Retrieve object using using composite pkey values.
* @param string $usr_uid
* @param string $tas_uid
* @param int $month
* @param int $year
* @param Connection $con
* @return UsrReporting
*/
public static function retrieveByPK($usr_uid, $tas_uid, $month, $year, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria();
$criteria->add(UsrReportingPeer::USR_UID, $usr_uid);
$criteria->add(UsrReportingPeer::TAS_UID, $tas_uid);
$criteria->add(UsrReportingPeer::MONTH, $month);
$criteria->add(UsrReportingPeer::YEAR, $year);
$v = UsrReportingPeer::doSelect($criteria, $con);
return !empty($v) ? $v[0] : null;
}
}
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
// the MapBuilder classes register themselves with Propel during initialization
// so we need to load them here.
try {
BaseUsrReportingPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
// even if Propel is not yet initialized, the map builder class can be registered
// now and then it will be loaded when Propel initializes.
require_once 'classes/model/map/UsrReportingMapBuilder.php';
Propel::registerMapBuilder('classes.model.map.UsrReportingMapBuilder');
}