/** * Selects a collection of BpmnDiagram objects pre-filled with all related objects. * * @return array Array of BpmnDiagram objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAll(Criteria $c, $con = null) { $c = clone $c; // Set the correct dbName if it has not been overridden if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } BpmnDiagramPeer::addSelectColumns($c); $startcol2 = BpmnDiagramPeer::NUM_COLUMNS - BpmnDiagramPeer::NUM_LAZY_LOAD_COLUMNS + 1; BpmnProjectPeer::addSelectColumns($c); $startcol3 = $startcol2 + BpmnProjectPeer::NUM_COLUMNS; $c->addJoin(BpmnDiagramPeer::PRJ_UID, BpmnProjectPeer::PRJ_UID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = BpmnDiagramPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); // Add objects for joined BpmnProject rows $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->addBpmnDiagram($obj1); // CHECKME break; } } if ($newObject) { $obj2->initBpmnDiagrams(); $obj2->addBpmnDiagram($obj1); } $results[] = $obj1; } return $results; }