First commit for the DASHLETS

This commit is contained in:
Julio Cesar Laura
2011-10-28 12:20:45 -04:00
parent 31281756e1
commit 98fe86c358
16 changed files with 4598 additions and 724 deletions

View File

@@ -0,0 +1,9 @@
<?php
G::LoadClass('pmDashlet');
class DashletGaugeIndicator extends PMDashlet {
//
}

View File

@@ -0,0 +1,15 @@
<?php
require_once 'interfaces/dashletInterface.php';
require_once 'model/Dashlet.php';
require_once 'model/DashletInstance.php';
class PMDashlet extends DashletInstance implements DashletInterface {
public function setup() {
}
public function render() {
}
}

View File

@@ -0,0 +1,8 @@
<?php
interface DashletInterface {
public function setup();
public function render();
}

View File

@@ -0,0 +1,19 @@
<?php
require_once 'classes/model/om/BaseDashlet.php';
/**
* Skeleton subclass for representing a row from the 'DASHLET' 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 Dashlet extends BaseDashlet {
} // Dashlet

View File

@@ -0,0 +1,19 @@
<?php
require_once 'classes/model/om/BaseDashletInstance.php';
/**
* Skeleton subclass for representing a row from the 'DASHLET_INSTANCE' 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 DashletInstance extends BaseDashletInstance {
} // DashletInstance

View File

@@ -0,0 +1,23 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseDashletInstancePeer.php';
// include object class
include_once 'classes/model/DashletInstance.php';
/**
* Skeleton subclass for performing query and update operations on the 'DASHLET_INSTANCE' 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 DashletInstancePeer extends BaseDashletInstancePeer {
} // DashletInstancePeer

View File

@@ -0,0 +1,23 @@
<?php
// include base peer class
require_once 'classes/model/om/BaseDashletPeer.php';
// include object class
include_once 'classes/model/Dashlet.php';
/**
* Skeleton subclass for performing query and update operations on the 'DASHLET' 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 DashletPeer extends BaseDashletPeer {
} // DashletPeer

View File

@@ -0,0 +1,97 @@
<?php
require_once 'propel/map/MapBuilder.php';
include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'DASHLET_INSTANCE' 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 DashletInstanceMapBuilder {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.DashletInstanceMapBuilder';
/**
* 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('DASHLET_INSTANCE');
$tMap->setPhpName('DashletInstance');
$tMap->setUseIdGenerator(false);
$tMap->addPrimaryKey('DAS_INS_UID', 'DasInsUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('DAS_UID', 'DasUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('DAS_INS_TYPE', 'DasInsType', 'string', CreoleTypes::VARCHAR, true, 20);
$tMap->addColumn('DAS_INS_CONTEXT_TIME', 'DasInsContextTime', 'string', CreoleTypes::VARCHAR, true, 20);
$tMap->addColumn('DAS_INS_START_DATE', 'DasInsStartDate', 'int', CreoleTypes::TIMESTAMP, false, null);
$tMap->addColumn('DAS_INS_END_DATE', 'DasInsEndDate', 'int', CreoleTypes::TIMESTAMP, false, null);
$tMap->addColumn('DAS_INS_OWNER_TYPE', 'DasInsOwnerType', 'string', CreoleTypes::VARCHAR, true, 20);
$tMap->addColumn('DAS_INS_OWNER_UID', 'DasInsOwnerUid', 'string', CreoleTypes::VARCHAR, false, 32);
$tMap->addColumn('DAS_INS_PROCESSES', 'DasInsProcesses', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('DAS_INS_TASKS', 'DasInsTasks', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('DAS_INS_ADDITIONAL_PROPERTIES', 'DasInsAdditionalProperties', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('DAS_INS_CREATE_DATE', 'DasInsCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
$tMap->addColumn('DAS_INS_UPDATE_DATE', 'DasInsUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
$tMap->addColumn('DAS_INS_STATUS', 'DasInsStatus', 'int', CreoleTypes::TINYINT, true, null);
} // doBuild()
} // DashletInstanceMapBuilder

View File

@@ -0,0 +1,85 @@
<?php
require_once 'propel/map/MapBuilder.php';
include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'DASHLET' 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 DashletMapBuilder {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.DashletMapBuilder';
/**
* 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('DASHLET');
$tMap->setPhpName('Dashlet');
$tMap->setUseIdGenerator(false);
$tMap->addPrimaryKey('DAS_UID', 'DasUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('DAS_CLASS', 'DasClass', 'string', CreoleTypes::VARCHAR, true, 50);
$tMap->addColumn('DAS_TITLE', 'DasTitle', 'string', CreoleTypes::VARCHAR, true, 255);
$tMap->addColumn('DAS_DESCRIPTION', 'DasDescription', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('DAS_VERSION', 'DasVersion', 'string', CreoleTypes::VARCHAR, true, 10);
$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()
} // DashletMapBuilder

View File

@@ -0,0 +1,919 @@
<?php
require_once 'propel/om/BaseObject.php';
require_once 'propel/om/Persistent.php';
include_once 'propel/util/Criteria.php';
include_once 'classes/model/DashletPeer.php';
/**
* Base class that represents a row from the 'DASHLET' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BaseDashlet 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 DashletPeer
*/
protected static $peer;
/**
* The value for the das_uid field.
* @var string
*/
protected $das_uid = '';
/**
* The value for the das_class field.
* @var string
*/
protected $das_class = '';
/**
* The value for the das_title field.
* @var string
*/
protected $das_title = '';
/**
* The value for the das_description field.
* @var string
*/
protected $das_description;
/**
* The value for the das_version field.
* @var string
*/
protected $das_version = '1.0';
/**
* The value for the das_create_date field.
* @var int
*/
protected $das_create_date;
/**
* The value for the das_update_date field.
* @var int
*/
protected $das_update_date;
/**
* The value for the das_status field.
* @var int
*/
protected $das_status = 1;
/**
* 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 [das_class] column value.
*
* @return string
*/
public function getDasClass()
{
return $this->das_class;
}
/**
* Get the [das_title] column value.
*
* @return string
*/
public function getDasTitle()
{
return $this->das_title;
}
/**
* Get the [das_description] column value.
*
* @return string
*/
public function getDasDescription()
{
return $this->das_description;
}
/**
* Get the [das_version] column value.
*
* @return string
*/
public function getDasVersion()
{
return $this->das_version;
}
/**
* Get the [optionally formatted] [das_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 getDasCreateDate($format = 'Y-m-d H:i:s')
{
if ($this->das_create_date === null || $this->das_create_date === '') {
return null;
} elseif (!is_int($this->das_create_date)) {
// a non-timestamp value was set externally, so we convert it
$ts = strtotime($this->das_create_date);
if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
throw new PropelException("Unable to parse value of [das_create_date] as date/time value: " . var_export($this->das_create_date, true));
}
} else {
$ts = $this->das_create_date;
}
if ($format === null) {
return $ts;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $ts);
} else {
return date($format, $ts);
}
}
/**
* Get the [optionally formatted] [das_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 getDasUpdateDate($format = 'Y-m-d H:i:s')
{
if ($this->das_update_date === null || $this->das_update_date === '') {
return null;
} elseif (!is_int($this->das_update_date)) {
// a non-timestamp value was set externally, so we convert it
$ts = strtotime($this->das_update_date);
if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
throw new PropelException("Unable to parse value of [das_update_date] as date/time value: " . var_export($this->das_update_date, true));
}
} else {
$ts = $this->das_update_date;
}
if ($format === null) {
return $ts;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $ts);
} else {
return date($format, $ts);
}
}
/**
* Get the [das_status] column value.
*
* @return int
*/
public function getDasStatus()
{
return $this->das_status;
}
/**
* 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[] = DashletPeer::DAS_UID;
}
} // setDasUid()
/**
* Set the value of [das_class] column.
*
* @param string $v new value
* @return void
*/
public function setDasClass($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_class !== $v || $v === '') {
$this->das_class = $v;
$this->modifiedColumns[] = DashletPeer::DAS_CLASS;
}
} // setDasClass()
/**
* Set the value of [das_title] column.
*
* @param string $v new value
* @return void
*/
public function setDasTitle($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_title !== $v || $v === '') {
$this->das_title = $v;
$this->modifiedColumns[] = DashletPeer::DAS_TITLE;
}
} // setDasTitle()
/**
* Set the value of [das_description] column.
*
* @param string $v new value
* @return void
*/
public function setDasDescription($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_description !== $v) {
$this->das_description = $v;
$this->modifiedColumns[] = DashletPeer::DAS_DESCRIPTION;
}
} // setDasDescription()
/**
* Set the value of [das_version] column.
*
* @param string $v new value
* @return void
*/
public function setDasVersion($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_version !== $v || $v === '1.0') {
$this->das_version = $v;
$this->modifiedColumns[] = DashletPeer::DAS_VERSION;
}
} // setDasVersion()
/**
* Set the value of [das_create_date] column.
*
* @param int $v new value
* @return void
*/
public function setDasCreateDate($v)
{
if ($v !== null && !is_int($v)) {
$ts = strtotime($v);
if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
throw new PropelException("Unable to parse date/time value for [das_create_date] from input: " . var_export($v, true));
}
} else {
$ts = $v;
}
if ($this->das_create_date !== $ts) {
$this->das_create_date = $ts;
$this->modifiedColumns[] = DashletPeer::DAS_CREATE_DATE;
}
} // setDasCreateDate()
/**
* Set the value of [das_update_date] column.
*
* @param int $v new value
* @return void
*/
public function setDasUpdateDate($v)
{
if ($v !== null && !is_int($v)) {
$ts = strtotime($v);
if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
throw new PropelException("Unable to parse date/time value for [das_update_date] from input: " . var_export($v, true));
}
} else {
$ts = $v;
}
if ($this->das_update_date !== $ts) {
$this->das_update_date = $ts;
$this->modifiedColumns[] = DashletPeer::DAS_UPDATE_DATE;
}
} // setDasUpdateDate()
/**
* Set the value of [das_status] column.
*
* @param int $v new value
* @return void
*/
public function setDasStatus($v)
{
// Since the native PHP type for this column is integer,
// we will cast the input value to an int (if it is not).
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->das_status !== $v || $v === 1) {
$this->das_status = $v;
$this->modifiedColumns[] = DashletPeer::DAS_STATUS;
}
} // setDasStatus()
/**
* 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->das_class = $rs->getString($startcol + 1);
$this->das_title = $rs->getString($startcol + 2);
$this->das_description = $rs->getString($startcol + 3);
$this->das_version = $rs->getString($startcol + 4);
$this->das_create_date = $rs->getTimestamp($startcol + 5, null);
$this->das_update_date = $rs->getTimestamp($startcol + 6, null);
$this->das_status = $rs->getInt($startcol + 7);
$this->resetModified();
$this->setNew(false);
// FIXME - using NUM_COLUMNS may be clearer.
return $startcol + 8; // 8 = DashletPeer::NUM_COLUMNS - DashletPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating Dashlet 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(DashletPeer::DATABASE_NAME);
}
try {
$con->begin();
DashletPeer::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 and any referring fk objects' save() operations.
* @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(DashletPeer::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 fk objects' save() operations.
* @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 = DashletPeer::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 += DashletPeer::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> objets otherwise.
*/
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if (($retval = DashletPeer::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 = DashletPeer::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->getDasClass();
break;
case 2:
return $this->getDasTitle();
break;
case 3:
return $this->getDasDescription();
break;
case 4:
return $this->getDasVersion();
break;
case 5:
return $this->getDasCreateDate();
break;
case 6:
return $this->getDasUpdateDate();
break;
case 7:
return $this->getDasStatus();
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 = DashletPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getDasUid(),
$keys[1] => $this->getDasClass(),
$keys[2] => $this->getDasTitle(),
$keys[3] => $this->getDasDescription(),
$keys[4] => $this->getDasVersion(),
$keys[5] => $this->getDasCreateDate(),
$keys[6] => $this->getDasUpdateDate(),
$keys[7] => $this->getDasStatus(),
);
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 = DashletPeer::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->setDasClass($value);
break;
case 2:
$this->setDasTitle($value);
break;
case 3:
$this->setDasDescription($value);
break;
case 4:
$this->setDasVersion($value);
break;
case 5:
$this->setDasCreateDate($value);
break;
case 6:
$this->setDasUpdateDate($value);
break;
case 7:
$this->setDasStatus($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 = DashletPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setDasUid($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setDasClass($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setDasTitle($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDasDescription($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setDasVersion($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setDasCreateDate($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setDasUpdateDate($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setDasStatus($arr[$keys[7]]);
}
/**
* 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(DashletPeer::DATABASE_NAME);
if ($this->isColumnModified(DashletPeer::DAS_UID)) $criteria->add(DashletPeer::DAS_UID, $this->das_uid);
if ($this->isColumnModified(DashletPeer::DAS_CLASS)) $criteria->add(DashletPeer::DAS_CLASS, $this->das_class);
if ($this->isColumnModified(DashletPeer::DAS_TITLE)) $criteria->add(DashletPeer::DAS_TITLE, $this->das_title);
if ($this->isColumnModified(DashletPeer::DAS_DESCRIPTION)) $criteria->add(DashletPeer::DAS_DESCRIPTION, $this->das_description);
if ($this->isColumnModified(DashletPeer::DAS_VERSION)) $criteria->add(DashletPeer::DAS_VERSION, $this->das_version);
if ($this->isColumnModified(DashletPeer::DAS_CREATE_DATE)) $criteria->add(DashletPeer::DAS_CREATE_DATE, $this->das_create_date);
if ($this->isColumnModified(DashletPeer::DAS_UPDATE_DATE)) $criteria->add(DashletPeer::DAS_UPDATE_DATE, $this->das_update_date);
if ($this->isColumnModified(DashletPeer::DAS_STATUS)) $criteria->add(DashletPeer::DAS_STATUS, $this->das_status);
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(DashletPeer::DATABASE_NAME);
$criteria->add(DashletPeer::DAS_UID, $this->das_uid);
return $criteria;
}
/**
* Returns the primary key for this object (row).
* @return string
*/
public function getPrimaryKey()
{
return $this->getDasUid();
}
/**
* Generic method to set the primary key (das_uid column).
*
* @param string $key Primary key.
* @return void
*/
public function setPrimaryKey($key)
{
$this->setDasUid($key);
}
/**
* Sets contents of passed object to values from current object.
*
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param object $copyObj An object of Dashlet (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->setDasClass($this->das_class);
$copyObj->setDasTitle($this->das_title);
$copyObj->setDasDescription($this->das_description);
$copyObj->setDasVersion($this->das_version);
$copyObj->setDasCreateDate($this->das_create_date);
$copyObj->setDasUpdateDate($this->das_update_date);
$copyObj->setDasStatus($this->das_status);
$copyObj->setNew(true);
$copyObj->setDasUid(''); // 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 Dashlet 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 DashletPeer
*/
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new DashletPeer();
}
return self::$peer;
}
} // BaseDashlet

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,630 @@
<?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 DashletInstancePeer::getOMClass()
include_once 'classes/model/DashletInstance.php';
/**
* Base static class for performing query and update operations on the 'DASHLET_INSTANCE' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BaseDashletInstancePeer {
/** the default database name for this class */
const DATABASE_NAME = 'workflow';
/** the table name for this class */
const TABLE_NAME = 'DASHLET_INSTANCE';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'classes.model.DashletInstance';
/** 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_INS_UID field */
const DAS_INS_UID = 'DASHLET_INSTANCE.DAS_INS_UID';
/** the column name for the DAS_UID field */
const DAS_UID = 'DASHLET_INSTANCE.DAS_UID';
/** the column name for the DAS_INS_TYPE field */
const DAS_INS_TYPE = 'DASHLET_INSTANCE.DAS_INS_TYPE';
/** the column name for the DAS_INS_CONTEXT_TIME field */
const DAS_INS_CONTEXT_TIME = 'DASHLET_INSTANCE.DAS_INS_CONTEXT_TIME';
/** the column name for the DAS_INS_START_DATE field */
const DAS_INS_START_DATE = 'DASHLET_INSTANCE.DAS_INS_START_DATE';
/** the column name for the DAS_INS_END_DATE field */
const DAS_INS_END_DATE = 'DASHLET_INSTANCE.DAS_INS_END_DATE';
/** the column name for the DAS_INS_OWNER_TYPE field */
const DAS_INS_OWNER_TYPE = 'DASHLET_INSTANCE.DAS_INS_OWNER_TYPE';
/** the column name for the DAS_INS_OWNER_UID field */
const DAS_INS_OWNER_UID = 'DASHLET_INSTANCE.DAS_INS_OWNER_UID';
/** the column name for the DAS_INS_PROCESSES field */
const DAS_INS_PROCESSES = 'DASHLET_INSTANCE.DAS_INS_PROCESSES';
/** the column name for the DAS_INS_TASKS field */
const DAS_INS_TASKS = 'DASHLET_INSTANCE.DAS_INS_TASKS';
/** the column name for the DAS_INS_ADDITIONAL_PROPERTIES field */
const DAS_INS_ADDITIONAL_PROPERTIES = 'DASHLET_INSTANCE.DAS_INS_ADDITIONAL_PROPERTIES';
/** the column name for the DAS_INS_CREATE_DATE field */
const DAS_INS_CREATE_DATE = 'DASHLET_INSTANCE.DAS_INS_CREATE_DATE';
/** the column name for the DAS_INS_UPDATE_DATE field */
const DAS_INS_UPDATE_DATE = 'DASHLET_INSTANCE.DAS_INS_UPDATE_DATE';
/** the column name for the DAS_INS_STATUS field */
const DAS_INS_STATUS = 'DASHLET_INSTANCE.DAS_INS_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 ('DasInsUid', 'DasUid', 'DasInsType', 'DasInsContextTime', 'DasInsStartDate', 'DasInsEndDate', 'DasInsOwnerType', 'DasInsOwnerUid', 'DasInsProcesses', 'DasInsTasks', 'DasInsAdditionalProperties', 'DasInsCreateDate', 'DasInsUpdateDate', 'DasInsStatus', ),
BasePeer::TYPE_COLNAME => array (DashletInstancePeer::DAS_INS_UID, DashletInstancePeer::DAS_UID, DashletInstancePeer::DAS_INS_TYPE, DashletInstancePeer::DAS_INS_CONTEXT_TIME, DashletInstancePeer::DAS_INS_START_DATE, DashletInstancePeer::DAS_INS_END_DATE, DashletInstancePeer::DAS_INS_OWNER_TYPE, DashletInstancePeer::DAS_INS_OWNER_UID, DashletInstancePeer::DAS_INS_PROCESSES, DashletInstancePeer::DAS_INS_TASKS, DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES, DashletInstancePeer::DAS_INS_CREATE_DATE, DashletInstancePeer::DAS_INS_UPDATE_DATE, DashletInstancePeer::DAS_INS_STATUS, ),
BasePeer::TYPE_FIELDNAME => array ('DAS_INS_UID', 'DAS_UID', 'DAS_INS_TYPE', 'DAS_INS_CONTEXT_TIME', 'DAS_INS_START_DATE', 'DAS_INS_END_DATE', 'DAS_INS_OWNER_TYPE', 'DAS_INS_OWNER_UID', 'DAS_INS_PROCESSES', 'DAS_INS_TASKS', 'DAS_INS_ADDITIONAL_PROPERTIES', 'DAS_INS_CREATE_DATE', 'DAS_INS_UPDATE_DATE', 'DAS_INS_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 ('DasInsUid' => 0, 'DasUid' => 1, 'DasInsType' => 2, 'DasInsContextTime' => 3, 'DasInsStartDate' => 4, 'DasInsEndDate' => 5, 'DasInsOwnerType' => 6, 'DasInsOwnerUid' => 7, 'DasInsProcesses' => 8, 'DasInsTasks' => 9, 'DasInsAdditionalProperties' => 10, 'DasInsCreateDate' => 11, 'DasInsUpdateDate' => 12, 'DasInsStatus' => 13, ),
BasePeer::TYPE_COLNAME => array (DashletInstancePeer::DAS_INS_UID => 0, DashletInstancePeer::DAS_UID => 1, DashletInstancePeer::DAS_INS_TYPE => 2, DashletInstancePeer::DAS_INS_CONTEXT_TIME => 3, DashletInstancePeer::DAS_INS_START_DATE => 4, DashletInstancePeer::DAS_INS_END_DATE => 5, DashletInstancePeer::DAS_INS_OWNER_TYPE => 6, DashletInstancePeer::DAS_INS_OWNER_UID => 7, DashletInstancePeer::DAS_INS_PROCESSES => 8, DashletInstancePeer::DAS_INS_TASKS => 9, DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES => 10, DashletInstancePeer::DAS_INS_CREATE_DATE => 11, DashletInstancePeer::DAS_INS_UPDATE_DATE => 12, DashletInstancePeer::DAS_INS_STATUS => 13, ),
BasePeer::TYPE_FIELDNAME => array ('DAS_INS_UID' => 0, 'DAS_UID' => 1, 'DAS_INS_TYPE' => 2, 'DAS_INS_CONTEXT_TIME' => 3, 'DAS_INS_START_DATE' => 4, 'DAS_INS_END_DATE' => 5, 'DAS_INS_OWNER_TYPE' => 6, 'DAS_INS_OWNER_UID' => 7, 'DAS_INS_PROCESSES' => 8, 'DAS_INS_TASKS' => 9, 'DAS_INS_ADDITIONAL_PROPERTIES' => 10, 'DAS_INS_CREATE_DATE' => 11, 'DAS_INS_UPDATE_DATE' => 12, 'DAS_INS_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/DashletInstanceMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.DashletInstanceMapBuilder');
}
/**
* 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 = DashletInstancePeer::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. DashletInstancePeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(DashletInstancePeer::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(DashletInstancePeer::DAS_INS_UID);
$criteria->addSelectColumn(DashletInstancePeer::DAS_UID);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_TYPE);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_CONTEXT_TIME);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_START_DATE);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_END_DATE);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_OWNER_TYPE);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_OWNER_UID);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_PROCESSES);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_TASKS);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_ADDITIONAL_PROPERTIES);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_CREATE_DATE);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_UPDATE_DATE);
$criteria->addSelectColumn(DashletInstancePeer::DAS_INS_STATUS);
}
const COUNT = 'COUNT(DASHLET_INSTANCE.DAS_INS_UID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT DASHLET_INSTANCE.DAS_INS_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(DashletInstancePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(DashletInstancePeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = DashletInstancePeer::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 DashletInstance
* @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 = DashletInstancePeer::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 DashletInstancePeer::populateObjects(DashletInstancePeer::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;
DashletInstancePeer::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 = DashletInstancePeer::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 DashletInstancePeer::CLASS_DEFAULT;
}
/**
* Method perform an INSERT on the database, given a DashletInstance or Criteria object.
*
* @param mixed $values Criteria or DashletInstance 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 DashletInstance 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 DashletInstance or Criteria object.
*
* @param mixed $values Criteria or DashletInstance object containing data that is used to create the UPDATE statement.
* @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
* @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(DashletInstancePeer::DAS_INS_UID);
$selectCriteria->add(DashletInstancePeer::DAS_INS_UID, $criteria->remove(DashletInstancePeer::DAS_INS_UID), $comparison);
} else { // $values is DashletInstance object
$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 DASHLET_INSTANCE 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(DashletInstancePeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a DashletInstance or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or DashletInstance 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(DashletInstancePeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} elseif ($values instanceof DashletInstance) {
$criteria = $values->buildPkeyCriteria();
} else {
// it must be the primary key
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(DashletInstancePeer::DAS_INS_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 DashletInstance 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 DashletInstance $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(DashletInstance $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(DashletInstancePeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(DashletInstancePeer::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(DashletInstancePeer::DATABASE_NAME, DashletInstancePeer::TABLE_NAME, $columns);
}
/**
* Retrieve a single object by pkey.
*
* @param mixed $pk the primary key.
* @param Connection $con the connection to use
* @return DashletInstance
*/
public static function retrieveByPK($pk, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(DashletInstancePeer::DATABASE_NAME);
$criteria->add(DashletInstancePeer::DAS_INS_UID, $pk);
$v = DashletInstancePeer::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(DashletInstancePeer::DAS_INS_UID, $pks, Criteria::IN);
$objs = DashletInstancePeer::doSelect($criteria, $con);
}
return $objs;
}
} // BaseDashletInstancePeer
// 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 {
BaseDashletInstancePeer::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/DashletInstanceMapBuilder.php';
Propel::registerMapBuilder('classes.model.map.DashletInstanceMapBuilder');
}

View File

@@ -0,0 +1,600 @@
<?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 DashletPeer::getOMClass()
include_once 'classes/model/Dashlet.php';
/**
* Base static class for performing query and update operations on the 'DASHLET' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BaseDashletPeer {
/** the default database name for this class */
const DATABASE_NAME = 'workflow';
/** the table name for this class */
const TABLE_NAME = 'DASHLET';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'classes.model.Dashlet';
/** The total number of columns. */
const NUM_COLUMNS = 8;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the DAS_UID field */
const DAS_UID = 'DASHLET.DAS_UID';
/** the column name for the DAS_CLASS field */
const DAS_CLASS = 'DASHLET.DAS_CLASS';
/** the column name for the DAS_TITLE field */
const DAS_TITLE = 'DASHLET.DAS_TITLE';
/** the column name for the DAS_DESCRIPTION field */
const DAS_DESCRIPTION = 'DASHLET.DAS_DESCRIPTION';
/** the column name for the DAS_VERSION field */
const DAS_VERSION = 'DASHLET.DAS_VERSION';
/** the column name for the DAS_CREATE_DATE field */
const DAS_CREATE_DATE = 'DASHLET.DAS_CREATE_DATE';
/** the column name for the DAS_UPDATE_DATE field */
const DAS_UPDATE_DATE = 'DASHLET.DAS_UPDATE_DATE';
/** the column name for the DAS_STATUS field */
const DAS_STATUS = 'DASHLET.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', 'DasClass', 'DasTitle', 'DasDescription', 'DasVersion', 'DasCreateDate', 'DasUpdateDate', 'DasStatus', ),
BasePeer::TYPE_COLNAME => array (DashletPeer::DAS_UID, DashletPeer::DAS_CLASS, DashletPeer::DAS_TITLE, DashletPeer::DAS_DESCRIPTION, DashletPeer::DAS_VERSION, DashletPeer::DAS_CREATE_DATE, DashletPeer::DAS_UPDATE_DATE, DashletPeer::DAS_STATUS, ),
BasePeer::TYPE_FIELDNAME => array ('DAS_UID', 'DAS_CLASS', 'DAS_TITLE', 'DAS_DESCRIPTION', 'DAS_VERSION', 'DAS_CREATE_DATE', 'DAS_UPDATE_DATE', 'DAS_STATUS', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
);
/**
* 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, 'DasClass' => 1, 'DasTitle' => 2, 'DasDescription' => 3, 'DasVersion' => 4, 'DasCreateDate' => 5, 'DasUpdateDate' => 6, 'DasStatus' => 7, ),
BasePeer::TYPE_COLNAME => array (DashletPeer::DAS_UID => 0, DashletPeer::DAS_CLASS => 1, DashletPeer::DAS_TITLE => 2, DashletPeer::DAS_DESCRIPTION => 3, DashletPeer::DAS_VERSION => 4, DashletPeer::DAS_CREATE_DATE => 5, DashletPeer::DAS_UPDATE_DATE => 6, DashletPeer::DAS_STATUS => 7, ),
BasePeer::TYPE_FIELDNAME => array ('DAS_UID' => 0, 'DAS_CLASS' => 1, 'DAS_TITLE' => 2, 'DAS_DESCRIPTION' => 3, 'DAS_VERSION' => 4, 'DAS_CREATE_DATE' => 5, 'DAS_UPDATE_DATE' => 6, 'DAS_STATUS' => 7, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
);
/**
* @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/DashletMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.DashletMapBuilder');
}
/**
* 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 = DashletPeer::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. DashletPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(DashletPeer::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(DashletPeer::DAS_UID);
$criteria->addSelectColumn(DashletPeer::DAS_CLASS);
$criteria->addSelectColumn(DashletPeer::DAS_TITLE);
$criteria->addSelectColumn(DashletPeer::DAS_DESCRIPTION);
$criteria->addSelectColumn(DashletPeer::DAS_VERSION);
$criteria->addSelectColumn(DashletPeer::DAS_CREATE_DATE);
$criteria->addSelectColumn(DashletPeer::DAS_UPDATE_DATE);
$criteria->addSelectColumn(DashletPeer::DAS_STATUS);
}
const COUNT = 'COUNT(DASHLET.DAS_UID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT DASHLET.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(DashletPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(DashletPeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = DashletPeer::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 Dashlet
* @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 = DashletPeer::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 DashletPeer::populateObjects(DashletPeer::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;
DashletPeer::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 = DashletPeer::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 DashletPeer::CLASS_DEFAULT;
}
/**
* Method perform an INSERT on the database, given a Dashlet or Criteria object.
*
* @param mixed $values Criteria or Dashlet 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 Dashlet 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 Dashlet or Criteria object.
*
* @param mixed $values Criteria or Dashlet object containing data that is used to create the UPDATE statement.
* @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
* @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(DashletPeer::DAS_UID);
$selectCriteria->add(DashletPeer::DAS_UID, $criteria->remove(DashletPeer::DAS_UID), $comparison);
} else { // $values is Dashlet object
$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 DASHLET 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(DashletPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a Dashlet or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or Dashlet 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(DashletPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} elseif ($values instanceof Dashlet) {
$criteria = $values->buildPkeyCriteria();
} else {
// it must be the primary key
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(DashletPeer::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 Dashlet 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 Dashlet $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(Dashlet $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(DashletPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(DashletPeer::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(DashletPeer::DATABASE_NAME, DashletPeer::TABLE_NAME, $columns);
}
/**
* Retrieve a single object by pkey.
*
* @param mixed $pk the primary key.
* @param Connection $con the connection to use
* @return Dashlet
*/
public static function retrieveByPK($pk, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(DashletPeer::DATABASE_NAME);
$criteria->add(DashletPeer::DAS_UID, $pk);
$v = DashletPeer::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(DashletPeer::DAS_UID, $pks, Criteria::IN);
$objs = DashletPeer::doSelect($criteria, $con);
}
return $objs;
}
} // BaseDashletPeer
// 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 {
BaseDashletPeer::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/DashletMapBuilder.php';
Propel::registerMapBuilder('classes.model.map.DashletMapBuilder');
}

View File

@@ -2775,4 +2775,106 @@
</vendor>
</index>
</table>
<table name="DASHLET">
<vendor type="mysql">
<parameter name="Name" value="DASHLET"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="129"/>
<parameter name="Avg_row_length" value="115"/>
<parameter name="Data_length" value="14860"/>
<parameter name="Max_data_length" value="281474976710655"/>
<parameter name="Index_length" value="5120"/>
<parameter name="Data_free" value="0"/>
<parameter name="Auto_increment" value=""/>
<parameter name="Create_time" value="2011-10-28 09:55:00"/>
<parameter name="Update_time" value="2011-10-28 09:55:00"/>
<parameter name="Check_time" value=""/>
<parameter name="Collation" value="utf8_general_ci"/>
<parameter name="Checksum" value=""/>
<parameter name="Create_options" value=""/>
<parameter name="Comment" value="Dashblets definitions"/>
</vendor>
<column name="DAS_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="" />
<column name="DAS_CLASS" type="VARCHAR" size="50" required="true" default="" />
<column name="DAS_TITLE" type="VARCHAR" size="255" required="true" default="" />
<column name="DAS_DESCRIPTION" type="LONGVARCHAR" required="false" />
<column name="DAS_VERSION" type="VARCHAR" size="10" required="true" default="1.0" />
<column name="DAS_CREATE_DATE" type="TIMESTAMP" required="true" />
<column name="DAS_UPDATE_DATE" type="TIMESTAMP" required="false" />
<column name="DAS_STATUS" type="TINYINT" required="true" default="1"/>
<index name="indexDashlet">
<index-column name="DAS_UID"/>
<vendor type="mysql">
<parameter name="Table" value="DASHLET"/>
<parameter name="Non_unique" value="1"/>
<parameter name="Key_name" value="indexDashlet"/>
<parameter name="Seq_in_index" value="1"/>
<parameter name="Column_name" value="DAS_UID"/>
<parameter name="Collation" value="A"/>
<parameter name="Cardinality" value=""/>
<parameter name="Sub_part" value=""/>
<parameter name="Packed" value=""/>
<parameter name="Null" value=""/>
<parameter name="Index_type" value="BTREE"/>
<parameter name="Comment" value=""/>
</vendor>
</index>
</table>
<table name="DASHLET_INSTANCE">
<vendor type="mysql">
<parameter name="Name" value="DASHLET_INSTANCE"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="129"/>
<parameter name="Avg_row_length" value="115"/>
<parameter name="Data_length" value="14860"/>
<parameter name="Max_data_length" value="281474976710655"/>
<parameter name="Index_length" value="5120"/>
<parameter name="Data_free" value="0"/>
<parameter name="Auto_increment" value=""/>
<parameter name="Create_time" value="2011-10-28 09:55:00"/>
<parameter name="Update_time" value="2011-10-28 09:55:00"/>
<parameter name="Check_time" value=""/>
<parameter name="Collation" value="utf8_general_ci"/>
<parameter name="Checksum" value=""/>
<parameter name="Create_options" value=""/>
<parameter name="Comment" value="Dashblets definitions"/>
</vendor>
<column name="DAS_INS_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="" />
<column name="DAS_UID" type="VARCHAR" size="32" required="true" default="" />
<column name="DAS_INS_TYPE" type="VARCHAR" size="20" required="true" default="" />
<column name="DAS_INS_CONTEXT_TIME" type="VARCHAR" size="20" required="true" default="" />
<column name="DAS_INS_START_DATE" type="TIMESTAMP" required="false" />
<column name="DAS_INS_END_DATE" type="TIMESTAMP" required="false" />
<column name="DAS_INS_OWNER_TYPE" type="VARCHAR" size="20" required="true" default="" />
<column name="DAS_INS_OWNER_UID" type="VARCHAR" size="32" required="false" default="" />
<column name="DAS_INS_PROCESSES" type="LONGVARCHAR" required="false" />
<column name="DAS_INS_TASKS" type="LONGVARCHAR" required="false" />
<column name="DAS_INS_ADDITIONAL_PROPERTIES" type="LONGVARCHAR" required="false" />
<column name="DAS_INS_CREATE_DATE" type="TIMESTAMP" required="true" />
<column name="DAS_INS_UPDATE_DATE" type="TIMESTAMP" required="false" />
<column name="DAS_INS_STATUS" type="TINYINT" required="true" default="1"/>
<index name="indexDashletInstance">
<index-column name="DAS_INS_UID"/>
<index-column name="DAS_UID"/>
<index-column name="DAS_INS_OWNER_UID"/>
<vendor type="mysql">
<parameter name="Table" value="DASHLET_INSTANCE"/>
<parameter name="Non_unique" value="1"/>
<parameter name="Key_name" value="indexDashletInstance"/>
<parameter name="Seq_in_index" value="1"/>
<parameter name="Column_name" value="DAS_INS_UID"/>
<parameter name="Collation" value="A"/>
<parameter name="Cardinality" value=""/>
<parameter name="Sub_part" value=""/>
<parameter name="Packed" value=""/>
<parameter name="Null" value=""/>
<parameter name="Index_type" value="BTREE"/>
<parameter name="Comment" value=""/>
</vendor>
</index>
</table>
</database>

File diff suppressed because it is too large Load Diff

View File

@@ -1363,3 +1363,45 @@ CREATE TABLE `APP_NOTES`
)ENGINE=MyISAM DEFAULT CHARSET='utf8' COMMENT='Application Notes';
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;
#-----------------------------------------------------------------------------
#-- DASHLET
#-----------------------------------------------------------------------------
DROP TABLE IF EXISTS `DASHLET`;
CREATE TABLE `DASHLET` (
`DAS_UID` VARCHAR(32) NOT NULL,
`DAS_CLASS` VARCHAR(50) NOT NULL,
`DAS_TITLE` VARCHAR(255) NOT NULL,
`DAS_DESCRIPTION` TEXT NOT NULL,
`DAS_VERSION` VARCHAR(10) NOT NULL DEFAULT '1.0',
`DAS_CREATE_DATE` DATETIME NOT NULL,
`DAS_UPDATE_DATE` DATETIME NOT NULL,
`DAS_STATUS` TINYINT(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`DAS_UID`),
KEY `indexDashlet`(`DAS_UID`),
) ENGINE=MyISAM DEFAULT CHARSET='utf8' COMMENT='Dashlets definitions';
#-----------------------------------------------------------------------------
#-- DASHLET
#-----------------------------------------------------------------------------
DROP TABLE IF EXISTS `DASHLET_INSTANCE`;
CREATE TABLE `DASHLET_INSTANCE` (
`DAS_INS_UID` VARCHAR(32) NOT NULL,
`DAS_UID` VARCHAR(32) NOT NULL,
`DAS_INS_TYPE` VARCHAR(20) NOT NULL,
`DAS_INS_CONTEXT_TIME` VARCHAR(20) NOT NULL,
`DAS_INS_START_DATE` DATETIME NOT NULL,
`DAS_INS_END_DATE` DATETIME NOT NULL,
`DAS_INS_OWNER_TYPE` VARCHAR(20) NOT NULL,
`DAS_INS_OWNER_UID` VARCHAR(32) NOT NULL,
`DAS_INS_PROCESSES` TEXT NOT NULL,
`DAS_INS_TASKS` TEXT NOT NULL,
`DAS_INS_ADDITIONAL_PROPERTIES` TEXT NOT NULL,
`DAS_INS_CREATE_DATE` DATETIME NOT NULL,
`DAS_INS_UPDATE_DATE` DATETIME NOT NULL,
`DAS_INS_STATUS` TINYINT(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`DAS_INS_UID`),
KEY `indexDashletInstance`(`DAS_INS_UID`, `DAS_UID`, `DAS_INS_OWNER_UID`),
) ENGINE=MyISAM DEFAULT CHARSET='utf8' COMMENT='Dashlet instances';