PM-1146 "Los pools y sus elementos contenidos no se graban al grabar el proyecto." SOLVED

This commit is contained in:
Freddy Daniel Rojas Valda
2014-12-20 16:45:26 -04:00
parent 76096583c3
commit 6202e95616
8 changed files with 7 additions and 673 deletions

View File

@@ -69,7 +69,7 @@ class BpmnLaneMapBuilder
$tMap->addForeignKey('PRJ_UID', 'PrjUid', 'string', CreoleTypes::VARCHAR, 'BPMN_PROJECT', 'PRJ_UID', true, 32);
$tMap->addForeignKey('LNS_UID', 'LnsUid', 'string', CreoleTypes::VARCHAR, 'BPMN_LANESET', 'LNS_UID', true, 32);
$tMap->addColumn('LNS_UID', 'LnsUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('LAN_NAME', 'LanName', 'string', CreoleTypes::VARCHAR, false, 255);

View File

@@ -68,11 +68,6 @@ abstract class BaseBpmnLane extends BaseObject implements Persistent
*/
protected $aBpmnProject;
/**
* @var BpmnLaneset
*/
protected $aBpmnLaneset;
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
@@ -221,10 +216,6 @@ abstract class BaseBpmnLane extends BaseObject implements Persistent
$this->modifiedColumns[] = BpmnLanePeer::LNS_UID;
}
if ($this->aBpmnLaneset !== null && $this->aBpmnLaneset->getLnsUid() !== $v) {
$this->aBpmnLaneset = null;
}
} // setLnsUid()
/**
@@ -425,13 +416,6 @@ abstract class BaseBpmnLane extends BaseObject implements Persistent
$this->setBpmnProject($this->aBpmnProject);
}
if ($this->aBpmnLaneset !== null) {
if ($this->aBpmnLaneset->isModified()) {
$affectedRows += $this->aBpmnLaneset->save($con);
}
$this->setBpmnLaneset($this->aBpmnLaneset);
}
// If this object has been modified, then save it to the database.
if ($this->isModified()) {
@@ -525,12 +509,6 @@ abstract class BaseBpmnLane extends BaseObject implements Persistent
}
}
if ($this->aBpmnLaneset !== null) {
if (!$this->aBpmnLaneset->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aBpmnLaneset->getValidationFailures());
}
}
if (($retval = BpmnLanePeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
@@ -903,56 +881,5 @@ abstract class BaseBpmnLane extends BaseObject implements Persistent
}
return $this->aBpmnProject;
}
/**
* Declares an association between this object and a BpmnLaneset object.
*
* @param BpmnLaneset $v
* @return void
* @throws PropelException
*/
public function setBpmnLaneset($v)
{
if ($v === null) {
$this->setLnsUid(NULL);
} else {
$this->setLnsUid($v->getLnsUid());
}
$this->aBpmnLaneset = $v;
}
/**
* Get the associated BpmnLaneset object
*
* @param Connection Optional Connection object.
* @return BpmnLaneset The associated BpmnLaneset object.
* @throws PropelException
*/
public function getBpmnLaneset($con = null)
{
// include the related Peer class
include_once 'classes/model/om/BaseBpmnLanesetPeer.php';
if ($this->aBpmnLaneset === null && (($this->lns_uid !== "" && $this->lns_uid !== null))) {
$this->aBpmnLaneset = BpmnLanesetPeer::retrieveByPK($this->lns_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 = BpmnLanesetPeer::retrieveByPK($this->lns_uid, $con);
$obj->addBpmnLanesets($this);
*/
}
return $this->aBpmnLaneset;
}
}

View File

@@ -356,45 +356,6 @@ abstract class BaseBpmnLanePeer
}
/**
* Returns the number of rows matching criteria, joining the related BpmnLaneset 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 doCountJoinBpmnLaneset(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(BpmnLanePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(BpmnLanePeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(BpmnLanePeer::LNS_UID, BpmnLanesetPeer::LNS_UID);
$rs = BpmnLanePeer::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 BpmnLane objects pre-filled with their BpmnProject objects.
*
@@ -453,64 +414,6 @@ abstract class BaseBpmnLanePeer
}
/**
* Selects a collection of BpmnLane objects pre-filled with their BpmnLaneset objects.
*
* @return array Array of BpmnLane objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinBpmnLaneset(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);
}
BpmnLanePeer::addSelectColumns($c);
$startcol = (BpmnLanePeer::NUM_COLUMNS - BpmnLanePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
BpmnLanesetPeer::addSelectColumns($c);
$c->addJoin(BpmnLanePeer::LNS_UID, BpmnLanesetPeer::LNS_UID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = BpmnLanePeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = BpmnLanesetPeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$newObject = true;
foreach($results as $temp_obj1) {
$temp_obj2 = $temp_obj1->getBpmnLaneset(); //CHECKME
if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
// e.g. $author->addBookRelatedByBookId()
$temp_obj2->addBpmnLane($obj1); //CHECKME
break;
}
}
if ($newObject) {
$obj2->initBpmnLanes();
$obj2->addBpmnLane($obj1); //CHECKME
}
$results[] = $obj1;
}
return $results;
}
/**
* Returns the number of rows matching criteria, joining all related tables
*
@@ -539,8 +442,6 @@ abstract class BaseBpmnLanePeer
$criteria->addJoin(BpmnLanePeer::PRJ_UID, BpmnProjectPeer::PRJ_UID);
$criteria->addJoin(BpmnLanePeer::LNS_UID, BpmnLanesetPeer::LNS_UID);
$rs = BpmnLanePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
@@ -573,13 +474,8 @@ abstract class BaseBpmnLanePeer
BpmnProjectPeer::addSelectColumns($c);
$startcol3 = $startcol2 + BpmnProjectPeer::NUM_COLUMNS;
BpmnLanesetPeer::addSelectColumns($c);
$startcol4 = $startcol3 + BpmnLanesetPeer::NUM_COLUMNS;
$c->addJoin(BpmnLanePeer::PRJ_UID, BpmnProjectPeer::PRJ_UID);
$c->addJoin(BpmnLanePeer::LNS_UID, BpmnLanesetPeer::LNS_UID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
@@ -613,244 +509,6 @@ abstract class BaseBpmnLanePeer
}
}
if ($newObject) {
$obj2->initBpmnLanes();
$obj2->addBpmnLane($obj1);
}
// Add objects for joined BpmnLaneset rows
$omClass = BpmnLanesetPeer::getOMClass();
$cls = Propel::import($omClass);
$obj3 = new $cls();
$obj3->hydrate($rs, $startcol3);
$newObject = true;
for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
$temp_obj1 = $results[$j];
$temp_obj3 = $temp_obj1->getBpmnLaneset(); // CHECKME
if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
$newObject = false;
$temp_obj3->addBpmnLane($obj1); // CHECKME
break;
}
}
if ($newObject) {
$obj3->initBpmnLanes();
$obj3->addBpmnLane($obj1);
}
$results[] = $obj1;
}
return $results;
}
/**
* Returns the number of rows matching criteria, joining the related BpmnProject 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 doCountJoinAllExceptBpmnProject(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(BpmnLanePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(BpmnLanePeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(BpmnLanePeer::LNS_UID, BpmnLanesetPeer::LNS_UID);
$rs = BpmnLanePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
// no rows returned; we infer that means 0 matches.
return 0;
}
}
/**
* Returns the number of rows matching criteria, joining the related BpmnLaneset 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 doCountJoinAllExceptBpmnLaneset(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(BpmnLanePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(BpmnLanePeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(BpmnLanePeer::PRJ_UID, BpmnProjectPeer::PRJ_UID);
$rs = BpmnLanePeer::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 BpmnLane objects pre-filled with all related objects except BpmnProject.
*
* @return array Array of BpmnLane objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAllExceptBpmnProject(Criteria $c, $con = null)
{
$c = clone $c;
// Set the correct dbName if it has not been overridden
// $c->getDbName() will return the same object if not set to another value
// so == check is okay and faster
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
BpmnLanePeer::addSelectColumns($c);
$startcol2 = (BpmnLanePeer::NUM_COLUMNS - BpmnLanePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
BpmnLanesetPeer::addSelectColumns($c);
$startcol3 = $startcol2 + BpmnLanesetPeer::NUM_COLUMNS;
$c->addJoin(BpmnLanePeer::LNS_UID, BpmnLanesetPeer::LNS_UID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = BpmnLanePeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = BpmnLanesetPeer::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->getBpmnLaneset(); //CHECKME
if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addBpmnLane($obj1);
break;
}
}
if ($newObject) {
$obj2->initBpmnLanes();
$obj2->addBpmnLane($obj1);
}
$results[] = $obj1;
}
return $results;
}
/**
* Selects a collection of BpmnLane objects pre-filled with all related objects except BpmnLaneset.
*
* @return array Array of BpmnLane objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAllExceptBpmnLaneset(Criteria $c, $con = null)
{
$c = clone $c;
// Set the correct dbName if it has not been overridden
// $c->getDbName() will return the same object if not set to another value
// so == check is okay and faster
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
BpmnLanePeer::addSelectColumns($c);
$startcol2 = (BpmnLanePeer::NUM_COLUMNS - BpmnLanePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
BpmnProjectPeer::addSelectColumns($c);
$startcol3 = $startcol2 + BpmnProjectPeer::NUM_COLUMNS;
$c->addJoin(BpmnLanePeer::PRJ_UID, BpmnProjectPeer::PRJ_UID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = BpmnLanePeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = BpmnProjectPeer::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->getBpmnProject(); //CHECKME
if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addBpmnLane($obj1);
break;
}
}
if ($newObject) {
$obj2->initBpmnLanes();
$obj2->addBpmnLane($obj1);

View File

@@ -79,18 +79,6 @@ abstract class BaseBpmnLaneset extends BaseObject implements Persistent
*/
protected $aBpmnProcess;
/**
* Collection to store aggregation of collBpmnLanes.
* @var array
*/
protected $collBpmnLanes;
/**
* The criteria used to select the current contents of collBpmnLanes.
* @var Criteria
*/
protected $lastBpmnLaneCriteria = null;
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
@@ -501,14 +489,6 @@ abstract class BaseBpmnLaneset extends BaseObject implements Persistent
$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
}
if ($this->collBpmnLanes !== null) {
foreach($this->collBpmnLanes as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
$this->alreadyInSave = false;
}
return $affectedRows;
@@ -598,14 +578,6 @@ abstract class BaseBpmnLaneset extends BaseObject implements Persistent
}
if ($this->collBpmnLanes !== null) {
foreach($this->collBpmnLanes as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
$this->alreadyInValidation = false;
}
@@ -895,18 +867,6 @@ abstract class BaseBpmnLaneset extends BaseObject implements Persistent
$copyObj->setLnsState($this->lns_state);
if ($deepCopy) {
// important: temporarily setNew(false) because this affects the behavior of
// the getter/setter methods for fkey referrer objects.
$copyObj->setNew(false);
foreach($this->getBpmnLanes() as $relObj) {
$copyObj->addBpmnLane($relObj->copy($deepCopy));
}
} // if ($deepCopy)
$copyObj->setNew(true);
$copyObj->setLnsUid(''); // this is a pkey column, so set to default value
@@ -1052,161 +1012,5 @@ abstract class BaseBpmnLaneset extends BaseObject implements Persistent
}
return $this->aBpmnProcess;
}
/**
* Temporary storage of collBpmnLanes to save a possible db hit in
* the event objects are add to the collection, but the
* complete collection is never requested.
* @return void
*/
public function initBpmnLanes()
{
if ($this->collBpmnLanes === null) {
$this->collBpmnLanes = array();
}
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this BpmnLaneset has previously
* been saved, it will retrieve related BpmnLanes from storage.
* If this BpmnLaneset is new, it will return
* an empty collection or the current collection, the criteria
* is ignored on a new object.
*
* @param Connection $con
* @param Criteria $criteria
* @throws PropelException
*/
public function getBpmnLanes($criteria = null, $con = null)
{
// include the Peer class
include_once 'classes/model/om/BaseBpmnLanePeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
if ($this->collBpmnLanes === null) {
if ($this->isNew()) {
$this->collBpmnLanes = array();
} else {
$criteria->add(BpmnLanePeer::LNS_UID, $this->getLnsUid());
BpmnLanePeer::addSelectColumns($criteria);
$this->collBpmnLanes = BpmnLanePeer::doSelect($criteria, $con);
}
} else {
// criteria has no effect for a new object
if (!$this->isNew()) {
// the following code is to determine if a new query is
// called for. If the criteria is the same as the last
// one, just return the collection.
$criteria->add(BpmnLanePeer::LNS_UID, $this->getLnsUid());
BpmnLanePeer::addSelectColumns($criteria);
if (!isset($this->lastBpmnLaneCriteria) || !$this->lastBpmnLaneCriteria->equals($criteria)) {
$this->collBpmnLanes = BpmnLanePeer::doSelect($criteria, $con);
}
}
}
$this->lastBpmnLaneCriteria = $criteria;
return $this->collBpmnLanes;
}
/**
* Returns the number of related BpmnLanes.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param Connection $con
* @throws PropelException
*/
public function countBpmnLanes($criteria = null, $distinct = false, $con = null)
{
// include the Peer class
include_once 'classes/model/om/BaseBpmnLanePeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
$criteria->add(BpmnLanePeer::LNS_UID, $this->getLnsUid());
return BpmnLanePeer::doCount($criteria, $distinct, $con);
}
/**
* Method called to associate a BpmnLane object to this object
* through the BpmnLane foreign key attribute
*
* @param BpmnLane $l BpmnLane
* @return void
* @throws PropelException
*/
public function addBpmnLane(BpmnLane $l)
{
$this->collBpmnLanes[] = $l;
$l->setBpmnLaneset($this);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this BpmnLaneset is new, it will return
* an empty collection; or if this BpmnLaneset has previously
* been saved, it will retrieve related BpmnLanes from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in BpmnLaneset.
*/
public function getBpmnLanesJoinBpmnProject($criteria = null, $con = null)
{
// include the Peer class
include_once 'classes/model/om/BaseBpmnLanePeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
if ($this->collBpmnLanes === null) {
if ($this->isNew()) {
$this->collBpmnLanes = array();
} else {
$criteria->add(BpmnLanePeer::LNS_UID, $this->getLnsUid());
$this->collBpmnLanes = BpmnLanePeer::doSelectJoinBpmnProject($criteria, $con);
}
} else {
// the following code is to determine if a new query is
// called for. If the criteria is the same as the last
// one, just return the collection.
$criteria->add(BpmnLanePeer::LNS_UID, $this->getLnsUid());
if (!isset($this->lastBpmnLaneCriteria) || !$this->lastBpmnLaneCriteria->equals($criteria)) {
$this->collBpmnLanes = BpmnLanePeer::doSelectJoinBpmnProject($criteria, $con);
}
}
$this->lastBpmnLaneCriteria = $criteria;
return $this->collBpmnLanes;
}
}

View File

@@ -3284,55 +3284,6 @@ abstract class BaseBpmnProject extends BaseObject implements Persistent
$l->setBpmnProject($this);
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this BpmnProject is new, it will return
* an empty collection; or if this BpmnProject has previously
* been saved, it will retrieve related BpmnLanes from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
* actually need in BpmnProject.
*/
public function getBpmnLanesJoinBpmnLaneset($criteria = null, $con = null)
{
// include the Peer class
include_once 'classes/model/om/BaseBpmnLanePeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
if ($this->collBpmnLanes === null) {
if ($this->isNew()) {
$this->collBpmnLanes = array();
} else {
$criteria->add(BpmnLanePeer::PRJ_UID, $this->getPrjUid());
$this->collBpmnLanes = BpmnLanePeer::doSelectJoinBpmnLaneset($criteria, $con);
}
} else {
// the following code is to determine if a new query is
// called for. If the criteria is the same as the last
// one, just return the collection.
$criteria->add(BpmnLanePeer::PRJ_UID, $this->getPrjUid());
if (!isset($this->lastBpmnLaneCriteria) || !$this->lastBpmnLaneCriteria->equals($criteria)) {
$this->collBpmnLanes = BpmnLanePeer::doSelectJoinBpmnLaneset($criteria, $con);
}
}
$this->lastBpmnLaneCriteria = $criteria;
return $this->collBpmnLanes;
}
/**
* Temporary storage of collBpmnParticipants to save a possible db hit in
* the event objects are add to the collection, but the