/** * Selects a collection of FileImportHistory objects pre-filled with all related objects except Schema. * * @return array Array of FileImportHistory objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAllExceptSchema(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); } FileImportHistoryPeer::addSelectColumns($c); $startcol2 = FileImportHistoryPeer::NUM_COLUMNS - FileImportHistoryPeer::NUM_LAZY_LOAD_COLUMNS + 1; UserPeer::addSelectColumns($c); $startcol3 = $startcol2 + UserPeer::NUM_COLUMNS; VocabularyPeer::addSelectColumns($c); $startcol4 = $startcol3 + VocabularyPeer::NUM_COLUMNS; BatchPeer::addSelectColumns($c); $startcol5 = $startcol4 + BatchPeer::NUM_COLUMNS; $c->addJoin(FileImportHistoryPeer::USER_ID, UserPeer::ID); $c->addJoin(FileImportHistoryPeer::VOCABULARY_ID, VocabularyPeer::ID); $c->addJoin(FileImportHistoryPeer::BATCH_ID, BatchPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = FileImportHistoryPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = UserPeer::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->getUser(); //CHECKME if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addFileImportHistory($obj1); break; } } if ($newObject) { $obj2->initFileImportHistorys(); $obj2->addFileImportHistory($obj1); } $omClass = VocabularyPeer::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->getVocabulary(); //CHECKME if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addFileImportHistory($obj1); break; } } if ($newObject) { $obj3->initFileImportHistorys(); $obj3->addFileImportHistory($obj1); } $omClass = BatchPeer::getOMClass(); $cls = Propel::import($omClass); $obj4 = new $cls(); $obj4->hydrate($rs, $startcol4); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj4 = $temp_obj1->getBatch(); //CHECKME if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) { $newObject = false; $temp_obj4->addFileImportHistory($obj1); break; } } if ($newObject) { $obj4->initFileImportHistorys(); $obj4->addFileImportHistory($obj1); } $results[] = $obj1; } return $results; }
/** * 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) { foreach (sfMixer::getCallables('BaseBatchPeer:addDoSelectRS:addDoSelectRS') as $callable) { call_user_func($callable, 'BaseBatchPeer', $criteria, $con); } if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } if (!$criteria->getSelectColumns()) { $criteria = clone $criteria; BatchPeer::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); }