/** * @static * @param string $connectionName * @return PropelPDO */ public static function instanciate($connectionName) { $propelConfiguration = Propel::getConfiguration(); if (isset($propelConfiguration['datasources'][$connectionName]['connection'])) { $parameters = $propelConfiguration['datasources'][$connectionName]['connection']; } else { if (isset($propelConfiguration['datasources'][Propel::getDefaultDB()])) { $propelConfiguration['datasources'][$connectionName] = $propelConfiguration['datasources'][Propel::getDefaultDB()]; Propel::setConfiguration(new PropelConfiguration($propelConfiguration)); $parameters = $propelConfiguration['datasources'][$connectionName]['connection']; } else { throw new Exception(sprintf("Unable to find connection parameters for connection '%s'", $connectionName)); } } return Propel::initConnection($parameters, $connectionName); }
public static function doSelectJoinAllExceptAcademicCalendar(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } LocationPeer::addSelectColumns($c); $startcol2 = LocationPeer::NUM_COLUMNS - LocationPeer::NUM_LAZY_LOAD_COLUMNS + 1; LocationCategoryPeer::addSelectColumns($c); $startcol3 = $startcol2 + LocationCategoryPeer::NUM_COLUMNS; LocationConditionPeer::addSelectColumns($c); $startcol4 = $startcol3 + LocationConditionPeer::NUM_COLUMNS; DepartmentPeer::addSelectColumns($c); $startcol5 = $startcol4 + DepartmentPeer::NUM_COLUMNS; $c->addJoin(LocationPeer::LOCATION_CATEGORY_ID, LocationCategoryPeer::ID); $c->addJoin(LocationPeer::LOCATION_CONDITION_ID, LocationConditionPeer::ID); $c->addJoin(LocationPeer::DEPARTMENT_ID, DepartmentPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = LocationPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = LocationCategoryPeer::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->getLocationCategory(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addLocation($obj1); break; } } if ($newObject) { $obj2->initLocations(); $obj2->addLocation($obj1); } $omClass = LocationConditionPeer::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->getLocationCondition(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addLocation($obj1); break; } } if ($newObject) { $obj3->initLocations(); $obj3->addLocation($obj1); } $omClass = DepartmentPeer::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->getDepartment(); if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) { $newObject = false; $temp_obj4->addLocation($obj1); break; } } if ($newObject) { $obj4->initLocations(); $obj4->addLocation($obj1); } $results[] = $obj1; } return $results; }
/** * Selects a collection of AbsenceEleveTraitement objects pre-filled with all related objects except ModifieParUtilisateur. * * @param Criteria $criteria * @param PropelPDO $con * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @return array Array of AbsenceEleveTraitement objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAllExceptModifieParUtilisateur(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $criteria = clone $criteria; // Set the correct dbName if it has not been overridden // $criteria->getDbName() will return the same object if not set to another value // so == check is okay and faster if ($criteria->getDbName() == Propel::getDefaultDB()) { $criteria->setDbName(self::DATABASE_NAME); } AbsenceEleveTraitementPeer::addSelectColumns($criteria); $startcol2 = AbsenceEleveTraitementPeer::NUM_HYDRATE_COLUMNS; AbsenceEleveTypePeer::addSelectColumns($criteria); $startcol3 = $startcol2 + AbsenceEleveTypePeer::NUM_HYDRATE_COLUMNS; AbsenceEleveMotifPeer::addSelectColumns($criteria); $startcol4 = $startcol3 + AbsenceEleveMotifPeer::NUM_HYDRATE_COLUMNS; AbsenceEleveJustificationPeer::addSelectColumns($criteria); $startcol5 = $startcol4 + AbsenceEleveJustificationPeer::NUM_HYDRATE_COLUMNS; $criteria->addJoin(AbsenceEleveTraitementPeer::A_TYPE_ID, AbsenceEleveTypePeer::ID, $join_behavior); $criteria->addJoin(AbsenceEleveTraitementPeer::A_MOTIF_ID, AbsenceEleveMotifPeer::ID, $join_behavior); $criteria->addJoin(AbsenceEleveTraitementPeer::A_JUSTIFICATION_ID, AbsenceEleveJustificationPeer::ID, $join_behavior); // soft_delete behavior if (AbsenceEleveTraitementQuery::isSoftDeleteEnabled()) { $criteria->add(AbsenceEleveTraitementPeer::DELETED_AT, null, Criteria::ISNULL); } else { AbsenceEleveTraitementPeer::enableSoftDelete(); } $stmt = BasePeer::doSelect($criteria, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = AbsenceEleveTraitementPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = AbsenceEleveTraitementPeer::getInstanceFromPool($key1))) { // We no longer rehydrate the object, since this can cause data loss. // See http://www.propelorm.org/ticket/509 // $obj1->hydrate($row, 0, true); // rehydrate } else { $cls = AbsenceEleveTraitementPeer::getOMClass(false); $obj1 = new $cls(); $obj1->hydrate($row); AbsenceEleveTraitementPeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded // Add objects for joined AbsenceEleveType rows $key2 = AbsenceEleveTypePeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = AbsenceEleveTypePeer::getInstanceFromPool($key2); if (!$obj2) { $cls = AbsenceEleveTypePeer::getOMClass(false); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); AbsenceEleveTypePeer::addInstanceToPool($obj2, $key2); } // if $obj2 already loaded // Add the $obj1 (AbsenceEleveTraitement) to the collection in $obj2 (AbsenceEleveType) $obj2->addAbsenceEleveTraitement($obj1); } // if joined row is not null // Add objects for joined AbsenceEleveMotif rows $key3 = AbsenceEleveMotifPeer::getPrimaryKeyHashFromRow($row, $startcol3); if ($key3 !== null) { $obj3 = AbsenceEleveMotifPeer::getInstanceFromPool($key3); if (!$obj3) { $cls = AbsenceEleveMotifPeer::getOMClass(false); $obj3 = new $cls(); $obj3->hydrate($row, $startcol3); AbsenceEleveMotifPeer::addInstanceToPool($obj3, $key3); } // if $obj3 already loaded // Add the $obj1 (AbsenceEleveTraitement) to the collection in $obj3 (AbsenceEleveMotif) $obj3->addAbsenceEleveTraitement($obj1); } // if joined row is not null // Add objects for joined AbsenceEleveJustification rows $key4 = AbsenceEleveJustificationPeer::getPrimaryKeyHashFromRow($row, $startcol4); if ($key4 !== null) { $obj4 = AbsenceEleveJustificationPeer::getInstanceFromPool($key4); if (!$obj4) { $cls = AbsenceEleveJustificationPeer::getOMClass(false); $obj4 = new $cls(); $obj4->hydrate($row, $startcol4); AbsenceEleveJustificationPeer::addInstanceToPool($obj4, $key4); } // if $obj4 already loaded // Add the $obj1 (AbsenceEleveTraitement) to the collection in $obj4 (AbsenceEleveJustification) $obj4->addAbsenceEleveTraitement($obj1); } // if joined row is not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }
public static function doSelectJoinAll(Criteria $c, $con = null) { foreach (sfMixer::getCallables('BasenahoWikiPagePeer:doSelectJoinAll:doSelectJoinAll') as $callable) { call_user_func($callable, 'BasenahoWikiPagePeer', $c, $con); } $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } nahoWikiPagePeer::addSelectColumns($c); $startcol2 = nahoWikiPagePeer::NUM_COLUMNS - nahoWikiPagePeer::NUM_LAZY_LOAD_COLUMNS + 1; nahoWikiWikiPeer::addSelectColumns($c); $startcol3 = $startcol2 + nahoWikiWikiPeer::NUM_COLUMNS; $c->addJoin(nahoWikiPagePeer::WIKI_ID, nahoWikiWikiPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = nahoWikiPagePeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = nahoWikiWikiPeer::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->getnahoWikiWiki(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addnahoWikiPage($obj1); break; } } if ($newObject) { $obj2->initnahoWikiPages(); $obj2->addnahoWikiPage($obj1); } $results[] = $obj1; } return $results; }
public static function doSelectJoinAllExceptCampus(Criteria $c, $con = null) { foreach (sfMixer::getCallables('BaseProjectApplicationPeer:doSelectJoinAllExcept:doSelectJoinAllExcept') as $callable) { call_user_func($callable, 'BaseProjectApplicationPeer', $c, $con); } $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } ProjectApplicationPeer::addSelectColumns($c); $startcol2 = ProjectApplicationPeer::NUM_COLUMNS - ProjectApplicationPeer::NUM_LAZY_LOAD_COLUMNS + 1; sfGuardUserPeer::addSelectColumns($c); $startcol3 = $startcol2 + sfGuardUserPeer::NUM_COLUMNS; sfGuardUserPeer::addSelectColumns($c); $startcol4 = $startcol3 + sfGuardUserPeer::NUM_COLUMNS; DepartmentPeer::addSelectColumns($c); $startcol5 = $startcol4 + DepartmentPeer::NUM_COLUMNS; $c->addJoin(ProjectApplicationPeer::CREATED_BY, sfGuardUserPeer::ID); $c->addJoin(ProjectApplicationPeer::OWNER_ID, sfGuardUserPeer::ID); $c->addJoin(ProjectApplicationPeer::DEPARTMENT_ID, DepartmentPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = ProjectApplicationPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = sfGuardUserPeer::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->getsfGuardUserRelatedByCreatedBy(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addProjectApplicationRelatedByCreatedBy($obj1); break; } } if ($newObject) { $obj2->initProjectApplicationsRelatedByCreatedBy(); $obj2->addProjectApplicationRelatedByCreatedBy($obj1); } $omClass = sfGuardUserPeer::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->getsfGuardUserRelatedByOwnerId(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addProjectApplicationRelatedByOwnerId($obj1); break; } } if ($newObject) { $obj3->initProjectApplicationsRelatedByOwnerId(); $obj3->addProjectApplicationRelatedByOwnerId($obj1); } $omClass = DepartmentPeer::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->getDepartment(); if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) { $newObject = false; $temp_obj4->addProjectApplication($obj1); break; } } if ($newObject) { $obj4->initProjectApplications(); $obj4->addProjectApplication($obj1); } $results[] = $obj1; } return $results; }
/** * Selects a collection of Module objects pre-filled with all related objects except ModuleHook. * * @param Criteria $c * @param PropelPDO $con * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @return array Array of Module objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAllExceptModuleHook(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $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); } ModulePeer::addSelectColumns($c); $startcol2 = ModulePeer::NUM_COLUMNS - ModulePeer::NUM_LAZY_LOAD_COLUMNS; AddOnPeer::addSelectColumns($c); $startcol3 = $startcol2 + (AddOnPeer::NUM_COLUMNS - AddOnPeer::NUM_LAZY_LOAD_COLUMNS); $c->addJoin(array(ModulePeer::ADD_ON), array(AddOnPeer::ID), $join_behavior); $stmt = BasePeer::doSelect($c, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = ModulePeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = ModulePeer::getInstanceFromPool($key1))) { // We no longer rehydrate the object, since this can cause data loss. // See http://propel.phpdb.org/trac/ticket/509 // $obj1->hydrate($row, 0, true); // rehydrate } else { $omClass = ModulePeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj1 = new $cls(); $obj1->hydrate($row); ModulePeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded // Add objects for joined AddOn rows $key2 = AddOnPeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = AddOnPeer::getInstanceFromPool($key2); if (!$obj2) { $omClass = AddOnPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); AddOnPeer::addInstanceToPool($obj2, $key2); } // if $obj2 already loaded // Add the $obj1 (Module) to the collection in $obj2 (AddOn) $obj2->addModule($obj1); } // if joined row is not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }
public static function doSelectJoinAll(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } SmCheckPeer::addSelectColumns($c); $startcol2 = SmCheckPeer::NUM_COLUMNS - SmCheckPeer::NUM_LAZY_LOAD_COLUMNS + 1; SmTemplatePeer::addSelectColumns($c); $startcol3 = $startcol2 + SmTemplatePeer::NUM_COLUMNS; $c->addJoin(SmCheckPeer::SM_TEMPLATE_ID, SmTemplatePeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = SmCheckPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = SmTemplatePeer::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->getSmTemplate(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addSmCheck($obj1); break; } } if ($newObject) { $obj2->initSmChecks(); $obj2->addSmCheck($obj1); } $results[] = $obj1; } return $results; }
/** * Selects a collection of Job objects pre-filled with all related objects except Chart. * * @param Criteria $criteria * @param PropelPDO $con * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @return array Array of Job objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAllExceptChart(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $criteria = clone $criteria; // Set the correct dbName if it has not been overridden // $criteria->getDbName() will return the same object if not set to another value // so == check is okay and faster if ($criteria->getDbName() == Propel::getDefaultDB()) { $criteria->setDbName(JobPeer::DATABASE_NAME); } JobPeer::addSelectColumns($criteria); $startcol2 = JobPeer::NUM_HYDRATE_COLUMNS; UserPeer::addSelectColumns($criteria); $startcol3 = $startcol2 + UserPeer::NUM_HYDRATE_COLUMNS; $criteria->addJoin(JobPeer::USER_ID, UserPeer::ID, $join_behavior); $stmt = BasePeer::doSelect($criteria, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = JobPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = JobPeer::getInstanceFromPool($key1))) { // We no longer rehydrate the object, since this can cause data loss. // See http://www.propelorm.org/ticket/509 // $obj1->hydrate($row, 0, true); // rehydrate } else { $cls = JobPeer::getOMClass(); $obj1 = new $cls(); $obj1->hydrate($row); JobPeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded // Add objects for joined User rows $key2 = UserPeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = UserPeer::getInstanceFromPool($key2); if (!$obj2) { $cls = UserPeer::getOMClass(); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); UserPeer::addInstanceToPool($obj2, $key2); } // if $obj2 already loaded // Add the $obj1 (Job) to the collection in $obj2 (User) $obj2->addJob($obj1); } // if joined row is not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }
/** * Selects a collection of {@link Product} objects with a {@link ProductI18n} translation populated. * * @param Criteria $criteria * @param string $culture * @param PropelPDO $con * @param string $join_behavior * * @return array */ public static function doSelectWithI18n(Criteria $criteria, $culture = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $criteria = clone $criteria; if (null === $culture) { $culture = sfPropel::getDefaultCulture(); } // Set the correct dbName if it has not been overridden if ($criteria->getDbName() == Propel::getDefaultDB()) { $criteria->setDbName(self::DATABASE_NAME); } ProductPeer::addSelectColumns($criteria); $startcol = ProductPeer::NUM_COLUMNS - ProductPeer::NUM_LAZY_LOAD_COLUMNS; ProductI18nPeer::addSelectColumns($criteria); $criteria->addJoin(ProductPeer::ID, ProductI18nPeer::ID, $join_behavior); $criteria->add(ProductI18nPeer::CULTURE, $culture); foreach (sfMixer::getCallables('BaseProduct:doSelectJoin:doSelectJoin') as $sf_hook) { call_user_func($sf_hook, 'Product', $criteria, $con); } $stmt = BasePeer::doSelect($criteria, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = ProductPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = ProductPeer::getInstanceFromPool($key1))) { // We no longer rehydrate the object, since this can cause data loss. // See http://propel.phpdb.org/trac/ticket/509 // $obj1->hydrate($row, 0, true); // rehydrate } else { $cls = ProductPeer::getOMClass(false); $obj1 = new $cls(); $obj1->hydrate($row); ProductPeer::addInstanceToPool($obj1, $key1); } // if $obj1 already loaded $key2 = ProductI18nPeer::getPrimaryKeyHashFromRow($row, $startcol); if ($key2 !== null) { $obj2 = ProductI18nPeer::getInstanceFromPool($key2); if (!$obj2) { $cls = ProductI18nPeer::getOMClass(false); $obj2 = new $cls(); $obj2->hydrate($row, $startcol); ProductI18nPeer::addInstanceToPool($obj2, $key2); } // if obj2 already loaded $obj1->setTranslationForCulture($obj2, $culture); } // if joined row was not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }
public static function doSelectJoinAllExceptColLocation(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } VOpacPeer::addSelectColumns($c); $startcol2 = VOpacPeer::NUM_COLUMNS - VOpacPeer::NUM_LAZY_LOAD_COLUMNS + 1; CatalogPeer::addSelectColumns($c); $startcol3 = $startcol2 + CatalogPeer::NUM_COLUMNS; DepartmentPeer::addSelectColumns($c); $startcol4 = $startcol3 + DepartmentPeer::NUM_COLUMNS; CatCategoryPeer::addSelectColumns($c); $startcol5 = $startcol4 + CatCategoryPeer::NUM_COLUMNS; ColStatusPeer::addSelectColumns($c); $startcol6 = $startcol5 + ColStatusPeer::NUM_COLUMNS; $c->addJoin(VOpacPeer::CATALOG_ID, CatalogPeer::ID); $c->addJoin(VOpacPeer::DEPARTMENT_ID, DepartmentPeer::ID); $c->addJoin(VOpacPeer::CAT_CATEGORY_ID, CatCategoryPeer::ID); $c->addJoin(VOpacPeer::COL_STATUS_ID, ColStatusPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = VOpacPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = CatalogPeer::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->getCatalog(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addVOpac($obj1); break; } } if ($newObject) { $obj2->initVOpacs(); $obj2->addVOpac($obj1); } $omClass = DepartmentPeer::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->getDepartment(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addVOpac($obj1); break; } } if ($newObject) { $obj3->initVOpacs(); $obj3->addVOpac($obj1); } $omClass = CatCategoryPeer::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->getCatCategory(); if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) { $newObject = false; $temp_obj4->addVOpac($obj1); break; } } if ($newObject) { $obj4->initVOpacs(); $obj4->addVOpac($obj1); } $omClass = ColStatusPeer::getOMClass(); $cls = Propel::import($omClass); $obj5 = new $cls(); $obj5->hydrate($rs, $startcol5); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj5 = $temp_obj1->getColStatus(); if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) { $newObject = false; $temp_obj5->addVOpac($obj1); break; } } if ($newObject) { $obj5->initVOpacs(); $obj5->addVOpac($obj1); } $results[] = $obj1; } return $results; }
public static function doSelectJoinAllExceptUser(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } AnswerPeer::addSelectColumns($c); $startcol2 = AnswerPeer::NUM_COLUMNS - AnswerPeer::NUM_LAZY_LOAD_COLUMNS + 1; QuestionPeer::addSelectColumns($c); $startcol3 = $startcol2 + QuestionPeer::NUM_COLUMNS; $c->addJoin(AnswerPeer::QUESTION_ID, QuestionPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = AnswerPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = QuestionPeer::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->getQuestion(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addAnswer($obj1); break; } } if ($newObject) { $obj2->initAnswers(); $obj2->addAnswer($obj1); } $results[] = $obj1; } return $results; }
public static function doSelectJoinAllExceptTalent(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } TestApplicantAchievementPeer::addSelectColumns($c); $startcol2 = TestApplicantAchievementPeer::NUM_COLUMNS - TestApplicantAchievementPeer::NUM_LAZY_LOAD_COLUMNS + 1; TestApplicantPeer::addSelectColumns($c); $startcol3 = $startcol2 + TestApplicantPeer::NUM_COLUMNS; $c->addJoin(TestApplicantAchievementPeer::TEST_APPLICANT_ID, TestApplicantPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = TestApplicantAchievementPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = TestApplicantPeer::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->getTestApplicant(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addTestApplicantAchievement($obj1); break; } } if ($newObject) { $obj2->initTestApplicantAchievements(); $obj2->addTestApplicantAchievement($obj1); } $results[] = $obj1; } return $results; }
public static function doSelectJoinAllExceptCourseSchedule(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } CourseScheduleTutorPeer::addSelectColumns($c); $startcol2 = CourseScheduleTutorPeer::NUM_COLUMNS - CourseScheduleTutorPeer::NUM_LAZY_LOAD_COLUMNS + 1; EmployeePeer::addSelectColumns($c); $startcol3 = $startcol2 + EmployeePeer::NUM_COLUMNS; $c->addJoin(CourseScheduleTutorPeer::EMPLOYEE_ID, EmployeePeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = CourseScheduleTutorPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = EmployeePeer::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->getEmployee(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addCourseScheduleTutor($obj1); break; } } if ($newObject) { $obj2->initCourseScheduleTutors(); $obj2->addCourseScheduleTutor($obj1); } $results[] = $obj1; } return $results; }
public static function doSelectJoinAllExceptAcademicCost(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } PaymentHistoryPeer::addSelectColumns($c); $startcol2 = PaymentHistoryPeer::NUM_COLUMNS - PaymentHistoryPeer::NUM_LAZY_LOAD_COLUMNS + 1; PaymentJournalPeer::addSelectColumns($c); $startcol3 = $startcol2 + PaymentJournalPeer::NUM_COLUMNS; $c->addJoin(PaymentHistoryPeer::PAYMENT_JOURNAL_ID, PaymentJournalPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = PaymentHistoryPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = PaymentJournalPeer::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->getPaymentJournal(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addPaymentHistory($obj1); break; } } if ($newObject) { $obj2->initPaymentHistorys(); $obj2->addPaymentHistory($obj1); } $results[] = $obj1; } return $results; }
public static function doSelectJoinAllExceptCur13TermSpec(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } Cur13GradePeer::addSelectColumns($c); $startcol2 = Cur13GradePeer::NUM_COLUMNS - Cur13GradePeer::NUM_LAZY_LOAD_COLUMNS + 1; StudentAccalPeer::addSelectColumns($c); $startcol3 = $startcol2 + StudentAccalPeer::NUM_COLUMNS; $c->addJoin(Cur13GradePeer::STUDENT_ACCAL_ID, StudentAccalPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = Cur13GradePeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = StudentAccalPeer::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->getStudentAccal(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addCur13Grade($obj1); break; } } if ($newObject) { $obj2->initCur13Grades(); $obj2->addCur13Grade($obj1); } $results[] = $obj1; } return $results; }
/** * Set the DatabaseMap name. If <code>null</code> is supplied, uses value * provided by <code>Propel::getDefaultDB()</code>. * * @param $dbName A String with the Database(Map) name. * @return void */ public function setDbName($dbName = null) { $this->dbName = $dbName === null ? Propel::getDefaultDB() : $dbName; }
/** * Selects a collection of EleveRegimeDoublant objects pre-filled with all related objects. * * @param Criteria $criteria * @param PropelPDO $con * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @return array Array of EleveRegimeDoublant objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $criteria = clone $criteria; // Set the correct dbName if it has not been overridden if ($criteria->getDbName() == Propel::getDefaultDB()) { $criteria->setDbName(self::DATABASE_NAME); } EleveRegimeDoublantPeer::addSelectColumns($criteria); $startcol2 = EleveRegimeDoublantPeer::NUM_HYDRATE_COLUMNS; ElevePeer::addSelectColumns($criteria); $startcol3 = $startcol2 + ElevePeer::NUM_HYDRATE_COLUMNS; $criteria->addJoin(EleveRegimeDoublantPeer::LOGIN, ElevePeer::LOGIN, $join_behavior); $stmt = BasePeer::doSelect($criteria, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = EleveRegimeDoublantPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = EleveRegimeDoublantPeer::getInstanceFromPool($key1))) { // We no longer rehydrate the object, since this can cause data loss. // See http://www.propelorm.org/ticket/509 // $obj1->hydrate($row, 0, true); // rehydrate } else { $cls = EleveRegimeDoublantPeer::getOMClass(false); $obj1 = new $cls(); $obj1->hydrate($row); EleveRegimeDoublantPeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded // Add objects for joined Eleve rows $key2 = ElevePeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = ElevePeer::getInstanceFromPool($key2); if (!$obj2) { $cls = ElevePeer::getOMClass(false); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); ElevePeer::addInstanceToPool($obj2, $key2); } // if obj2 loaded // Add the $obj1 (EleveRegimeDoublant) to the collection in $obj2 (Eleve) $obj1->setEleve($obj2); } // if joined row not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }
public static function doSelectJoinAllExceptMonth(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } AccalPeriodPeer::addSelectColumns($c); $startcol2 = AccalPeriodPeer::NUM_COLUMNS - AccalPeriodPeer::NUM_LAZY_LOAD_COLUMNS + 1; AcademicCalendarPeer::addSelectColumns($c); $startcol3 = $startcol2 + AcademicCalendarPeer::NUM_COLUMNS; $c->addJoin(AccalPeriodPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = AccalPeriodPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = AcademicCalendarPeer::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->getAcademicCalendar(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addAccalPeriod($obj1); break; } } if ($newObject) { $obj2->initAccalPeriods(); $obj2->addAccalPeriod($obj1); } $results[] = $obj1; } return $results; }
/** * Selects a collection of Subscriber objects pre-filled with all related objects except UserRelatedByUpdatedBy. * * @param Criteria $criteria * @param PropelPDO $con * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @return array Array of Subscriber objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAllExceptUserRelatedByUpdatedBy(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $criteria = clone $criteria; // Set the correct dbName if it has not been overridden // $criteria->getDbName() will return the same object if not set to another value // so == check is okay and faster if ($criteria->getDbName() == Propel::getDefaultDB()) { $criteria->setDbName(SubscriberPeer::DATABASE_NAME); } SubscriberPeer::addSelectColumns($criteria); $startcol2 = SubscriberPeer::NUM_HYDRATE_COLUMNS; $stmt = BasePeer::doSelect($criteria, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = SubscriberPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = SubscriberPeer::getInstanceFromPool($key1))) { // We no longer rehydrate the object, since this can cause data loss. // See http://www.propelorm.org/ticket/509 // $obj1->hydrate($row, 0, true); // rehydrate } else { $cls = SubscriberPeer::getOMClass(); $obj1 = new $cls(); $obj1->hydrate($row); SubscriberPeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded $results[] = $obj1; } $stmt->closeCursor(); return $results; }
/** * Selects a collection of favorite objects pre-filled with all related objects. * * @param Criteria $criteria * @param PropelPDO $con * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @return array Array of favorite objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $criteria = clone $criteria; // Set the correct dbName if it has not been overridden if ($criteria->getDbName() == Propel::getDefaultDB()) { $criteria->setDbName(self::DATABASE_NAME); } favoritePeer::addSelectColumns($criteria); $startcol2 = favoritePeer::NUM_COLUMNS - favoritePeer::NUM_LAZY_LOAD_COLUMNS; kuserPeer::addSelectColumns($criteria); $startcol3 = $startcol2 + (kuserPeer::NUM_COLUMNS - kuserPeer::NUM_LAZY_LOAD_COLUMNS); $criteria->addJoin(favoritePeer::KUSER_ID, kuserPeer::ID, $join_behavior); $stmt = favoritePeer::doSelectStmt($criteria, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = favoritePeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = favoritePeer::getInstanceFromPool($key1))) { // We no longer rehydrate the object, since this can cause data loss. // See http://propel.phpdb.org/trac/ticket/509 // $obj1->hydrate($row, 0, true); // rehydrate } else { $cls = favoritePeer::getOMClass(false); $obj1 = new $cls(); $obj1->hydrate($row); favoritePeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded // Add objects for joined kuser rows $key2 = kuserPeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = kuserPeer::getInstanceFromPool($key2); if (!$obj2) { $cls = kuserPeer::getOMClass(false); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); kuserPeer::addInstanceToPool($obj2, $key2); } // if obj2 loaded // Add the $obj1 (favorite) to the collection in $obj2 (kuser) $obj2->addfavorite($obj1); } // if joined row not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }
/** * Selects a collection of Member objects pre-filled with all related objects except MemberRelatedByMasterMemberId. * * @param Criteria $c * @param PropelPDO $con * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @return array Array of Member objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAllExceptMemberRelatedByMasterMemberId(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $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); } MemberPeer::addSelectColumns($c); $startcol2 = MemberPeer::NUM_COLUMNS - MemberPeer::NUM_LAZY_LOAD_COLUMNS; PersonPeer::addSelectColumns($c); $startcol3 = $startcol2 + (PersonPeer::NUM_COLUMNS - PersonPeer::NUM_LAZY_LOAD_COLUMNS); WingPeer::addSelectColumns($c); $startcol4 = $startcol3 + (WingPeer::NUM_COLUMNS - WingPeer::NUM_LAZY_LOAD_COLUMNS); MemberClassPeer::addSelectColumns($c); $startcol5 = $startcol4 + (MemberClassPeer::NUM_COLUMNS - MemberClassPeer::NUM_LAZY_LOAD_COLUMNS); $c->addJoin(array(MemberPeer::PERSON_ID), array(PersonPeer::ID), $join_behavior); $c->addJoin(array(MemberPeer::WING_ID), array(WingPeer::ID), $join_behavior); $c->addJoin(array(MemberPeer::MEMBER_CLASS_ID), array(MemberClassPeer::ID), $join_behavior); $stmt = BasePeer::doSelect($c, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = MemberPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = MemberPeer::getInstanceFromPool($key1))) { // We no longer rehydrate the object, since this can cause data loss. // See http://propel.phpdb.org/trac/ticket/509 // $obj1->hydrate($row, 0, true); // rehydrate } else { $omClass = MemberPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj1 = new $cls(); $obj1->hydrate($row); MemberPeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded // Add objects for joined Person rows $key2 = PersonPeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = PersonPeer::getInstanceFromPool($key2); if (!$obj2) { $omClass = PersonPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); PersonPeer::addInstanceToPool($obj2, $key2); } // if $obj2 already loaded // Add the $obj1 (Member) to the collection in $obj2 (Person) $obj2->addMember($obj1); } // if joined row is not null // Add objects for joined Wing rows $key3 = WingPeer::getPrimaryKeyHashFromRow($row, $startcol3); if ($key3 !== null) { $obj3 = WingPeer::getInstanceFromPool($key3); if (!$obj3) { $omClass = WingPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj3 = new $cls(); $obj3->hydrate($row, $startcol3); WingPeer::addInstanceToPool($obj3, $key3); } // if $obj3 already loaded // Add the $obj1 (Member) to the collection in $obj3 (Wing) $obj3->addMember($obj1); } // if joined row is not null // Add objects for joined MemberClass rows $key4 = MemberClassPeer::getPrimaryKeyHashFromRow($row, $startcol4); if ($key4 !== null) { $obj4 = MemberClassPeer::getInstanceFromPool($key4); if (!$obj4) { $omClass = MemberClassPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj4 = new $cls(); $obj4->hydrate($row, $startcol4); MemberClassPeer::addInstanceToPool($obj4, $key4); } // if $obj4 already loaded // Add the $obj1 (Member) to the collection in $obj4 (MemberClass) $obj4->addMember($obj1); } // if joined row is not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }
/** * Selects a collection of Horaris objects pre-filled with all related objects. * * @param Criteria $criteria * @param PropelPDO $con * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @return array Array of Horaris objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $criteria = clone $criteria; // Set the correct dbName if it has not been overridden if ($criteria->getDbName() == Propel::getDefaultDB()) { $criteria->setDbName(self::DATABASE_NAME); } HorarisPeer::addSelectColumns($criteria); $startcol2 = HorarisPeer::NUM_COLUMNS - HorarisPeer::NUM_LAZY_LOAD_COLUMNS; ActivitatsPeer::addSelectColumns($criteria); $startcol3 = $startcol2 + (ActivitatsPeer::NUM_COLUMNS - ActivitatsPeer::NUM_LAZY_LOAD_COLUMNS); $criteria->addJoin(HorarisPeer::ACTIVITATS_ACTIVITATID, ActivitatsPeer::ACTIVITATID, $join_behavior); // symfony_behaviors behavior foreach (sfMixer::getCallables(self::getMixerPreSelectHook(__FUNCTION__)) as $sf_hook) { call_user_func($sf_hook, 'BaseHorarisPeer', $criteria, $con); } $stmt = BasePeer::doSelect($criteria, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = HorarisPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = HorarisPeer::getInstanceFromPool($key1))) { // We no longer rehydrate the object, since this can cause data loss. // See http://propel.phpdb.org/trac/ticket/509 // $obj1->hydrate($row, 0, true); // rehydrate } else { $cls = HorarisPeer::getOMClass(false); $obj1 = new $cls(); $obj1->hydrate($row); HorarisPeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded // Add objects for joined Activitats rows $key2 = ActivitatsPeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = ActivitatsPeer::getInstanceFromPool($key2); if (!$obj2) { $cls = ActivitatsPeer::getOMClass(false); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); ActivitatsPeer::addInstanceToPool($obj2, $key2); } // if obj2 loaded // Add the $obj1 (Horaris) to the collection in $obj2 (Activitats) $obj2->addHoraris($obj1); } // if joined row not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }
public static function doSelectJoinAllExceptDepartment(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } GradeComponentPeer::addSelectColumns($c); $startcol2 = GradeComponentPeer::NUM_COLUMNS - GradeComponentPeer::NUM_LAZY_LOAD_COLUMNS + 1; GradeSpecPeer::addSelectColumns($c); $startcol3 = $startcol2 + GradeSpecPeer::NUM_COLUMNS; $c->addJoin(GradeComponentPeer::GRADE_SPEC_ID, GradeSpecPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = GradeComponentPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = GradeSpecPeer::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->getGradeSpec(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addGradeComponent($obj1); break; } } if ($newObject) { $obj2->initGradeComponents(); $obj2->addGradeComponent($obj1); } $results[] = $obj1; } return $results; }
public static function doSelectJoinAllExceptEmployeeDivision(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } EmployeeDetailPeer::addSelectColumns($c); $startcol2 = EmployeeDetailPeer::NUM_COLUMNS - EmployeeDetailPeer::NUM_LAZY_LOAD_COLUMNS + 1; EmployeePeer::addSelectColumns($c); $startcol3 = $startcol2 + EmployeePeer::NUM_COLUMNS; ReligionPeer::addSelectColumns($c); $startcol4 = $startcol3 + ReligionPeer::NUM_COLUMNS; ReligionPeer::addSelectColumns($c); $startcol5 = $startcol4 + ReligionPeer::NUM_COLUMNS; EmployeeLevelPeer::addSelectColumns($c); $startcol6 = $startcol5 + EmployeeLevelPeer::NUM_COLUMNS; MaritalStatusPeer::addSelectColumns($c); $startcol7 = $startcol6 + MaritalStatusPeer::NUM_COLUMNS; $c->addJoin(EmployeeDetailPeer::EMPLOYEE_ID, EmployeePeer::ID); $c->addJoin(EmployeeDetailPeer::RELIGION_ID, ReligionPeer::ID); $c->addJoin(EmployeeDetailPeer::SPOUSE_RELIGION_ID, ReligionPeer::ID); $c->addJoin(EmployeeDetailPeer::EMPLOYEE_LEVEL_ID, EmployeeLevelPeer::ID); $c->addJoin(EmployeeDetailPeer::MARITAL_STATUS_ID, MaritalStatusPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = EmployeeDetailPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = EmployeePeer::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->getEmployee(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addEmployeeDetail($obj1); break; } } if ($newObject) { $obj2->initEmployeeDetails(); $obj2->addEmployeeDetail($obj1); } $omClass = ReligionPeer::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->getReligionRelatedByReligionId(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addEmployeeDetailRelatedByReligionId($obj1); break; } } if ($newObject) { $obj3->initEmployeeDetailsRelatedByReligionId(); $obj3->addEmployeeDetailRelatedByReligionId($obj1); } $omClass = ReligionPeer::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->getReligionRelatedBySpouseReligionId(); if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) { $newObject = false; $temp_obj4->addEmployeeDetailRelatedBySpouseReligionId($obj1); break; } } if ($newObject) { $obj4->initEmployeeDetailsRelatedBySpouseReligionId(); $obj4->addEmployeeDetailRelatedBySpouseReligionId($obj1); } $omClass = EmployeeLevelPeer::getOMClass(); $cls = Propel::import($omClass); $obj5 = new $cls(); $obj5->hydrate($rs, $startcol5); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj5 = $temp_obj1->getEmployeeLevel(); if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) { $newObject = false; $temp_obj5->addEmployeeDetail($obj1); break; } } if ($newObject) { $obj5->initEmployeeDetails(); $obj5->addEmployeeDetail($obj1); } $omClass = MaritalStatusPeer::getOMClass(); $cls = Propel::import($omClass); $obj6 = new $cls(); $obj6->hydrate($rs, $startcol6); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj6 = $temp_obj1->getMaritalStatus(); if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) { $newObject = false; $temp_obj6->addEmployeeDetail($obj1); break; } } if ($newObject) { $obj6->initEmployeeDetails(); $obj6->addEmployeeDetail($obj1); } $results[] = $obj1; } return $results; }
/** * Selects a collection of PcBlogComment objects pre-filled with all related objects except PcUser. * * @param Criteria $criteria * @param PropelPDO $con * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @return array Array of PcBlogComment objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAllExceptPcUser(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $criteria = clone $criteria; // Set the correct dbName if it has not been overridden // $criteria->getDbName() will return the same object if not set to another value // so == check is okay and faster if ($criteria->getDbName() == Propel::getDefaultDB()) { $criteria->setDbName(self::DATABASE_NAME); } PcBlogCommentPeer::addSelectColumns($criteria); $startcol2 = PcBlogCommentPeer::NUM_COLUMNS - PcBlogCommentPeer::NUM_LAZY_LOAD_COLUMNS; PcBlogPostPeer::addSelectColumns($criteria); $startcol3 = $startcol2 + (PcBlogPostPeer::NUM_COLUMNS - PcBlogPostPeer::NUM_LAZY_LOAD_COLUMNS); $criteria->addJoin(PcBlogCommentPeer::POST_ID, PcBlogPostPeer::ID, $join_behavior); // symfony_behaviors behavior foreach (sfMixer::getCallables(self::getMixerPreSelectHook(__FUNCTION__)) as $sf_hook) { call_user_func($sf_hook, 'BasePcBlogCommentPeer', $criteria, $con); } $stmt = BasePeer::doSelect($criteria, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = PcBlogCommentPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = PcBlogCommentPeer::getInstanceFromPool($key1))) { // We no longer rehydrate the object, since this can cause data loss. // See http://propel.phpdb.org/trac/ticket/509 // $obj1->hydrate($row, 0, true); // rehydrate } else { $cls = PcBlogCommentPeer::getOMClass(false); $obj1 = new $cls(); $obj1->hydrate($row); PcBlogCommentPeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded // Add objects for joined PcBlogPost rows $key2 = PcBlogPostPeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = PcBlogPostPeer::getInstanceFromPool($key2); if (!$obj2) { $cls = PcBlogPostPeer::getOMClass(false); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); PcBlogPostPeer::addInstanceToPool($obj2, $key2); } // if $obj2 already loaded // Add the $obj1 (PcBlogComment) to the collection in $obj2 (PcBlogPost) $obj2->addPcBlogComment($obj1); } // if joined row is not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }
/** * Selects a collection of GalleryImage objects pre-filled with all related objects. * * @param Criteria $criteria * @param PropelPDO $con * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @return array Array of GalleryImage objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $criteria = clone $criteria; // Set the correct dbName if it has not been overridden if ($criteria->getDbName() == Propel::getDefaultDB()) { $criteria->setDbName(GalleryImagePeer::DATABASE_NAME); } GalleryImagePeer::addSelectColumns($criteria); $startcol2 = GalleryImagePeer::NUM_HYDRATE_COLUMNS; GalleryFolderPeer::addSelectColumns($criteria); $startcol3 = $startcol2 + GalleryFolderPeer::NUM_HYDRATE_COLUMNS; $criteria->addJoin(GalleryImagePeer::GALLERY_FOLDER_ID, GalleryFolderPeer::ID, $join_behavior); // symfony_behaviors behavior foreach (sfMixer::getCallables(self::getMixerPreSelectHook(__FUNCTION__)) as $sf_hook) { call_user_func($sf_hook, 'BaseGalleryImagePeer', $criteria, $con); } $stmt = BasePeer::doSelect($criteria, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = GalleryImagePeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = GalleryImagePeer::getInstanceFromPool($key1))) { // We no longer rehydrate the object, since this can cause data loss. // See http://www.propelorm.org/ticket/509 // $obj1->hydrate($row, 0, true); // rehydrate } else { $cls = GalleryImagePeer::getOMClass(); $obj1 = new $cls(); $obj1->hydrate($row); GalleryImagePeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded // Add objects for joined GalleryFolder rows $key2 = GalleryFolderPeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = GalleryFolderPeer::getInstanceFromPool($key2); if (!$obj2) { $cls = GalleryFolderPeer::getOMClass(); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); GalleryFolderPeer::addInstanceToPool($obj2, $key2); } // if obj2 loaded // Add the $obj1 (GalleryImage) to the collection in $obj2 (GalleryFolder) $obj2->addGalleryImage($obj1); } // if joined row not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }
/** * Selects a collection of NagiosMainConfiguration objects pre-filled with all related objects except NagiosCommandRelatedByGlobalHostEventHandler. * * @param Criteria $c * @param PropelPDO $con * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @return array Array of NagiosMainConfiguration objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAllExceptNagiosCommandRelatedByGlobalHostEventHandler(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $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); } NagiosMainConfigurationPeer::addSelectColumns($c); $startcol2 = NagiosMainConfigurationPeer::NUM_COLUMNS - NagiosMainConfigurationPeer::NUM_LAZY_LOAD_COLUMNS; $stmt = BasePeer::doSelect($c, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = NagiosMainConfigurationPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = NagiosMainConfigurationPeer::getInstanceFromPool($key1))) { // We no longer rehydrate the object, since this can cause data loss. // See http://propel.phpdb.org/trac/ticket/509 // $obj1->hydrate($row, 0, true); // rehydrate } else { $omClass = NagiosMainConfigurationPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj1 = new $cls(); $obj1->hydrate($row); NagiosMainConfigurationPeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded $results[] = $obj1; } $stmt->closeCursor(); return $results; }
/** * Selects a collection of NagiosEscalation objects pre-filled with all related objects except NagiosTimeperiod. * * @param Criteria $c * @param PropelPDO $con * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @return array Array of NagiosEscalation objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAllExceptNagiosTimeperiod(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $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); } NagiosEscalationPeer::addSelectColumns($c); $startcol2 = NagiosEscalationPeer::NUM_COLUMNS - NagiosEscalationPeer::NUM_LAZY_LOAD_COLUMNS; NagiosHostTemplatePeer::addSelectColumns($c); $startcol3 = $startcol2 + (NagiosHostTemplatePeer::NUM_COLUMNS - NagiosHostTemplatePeer::NUM_LAZY_LOAD_COLUMNS); NagiosHostPeer::addSelectColumns($c); $startcol4 = $startcol3 + (NagiosHostPeer::NUM_COLUMNS - NagiosHostPeer::NUM_LAZY_LOAD_COLUMNS); NagiosServiceTemplatePeer::addSelectColumns($c); $startcol5 = $startcol4 + (NagiosServiceTemplatePeer::NUM_COLUMNS - NagiosServiceTemplatePeer::NUM_LAZY_LOAD_COLUMNS); NagiosServicePeer::addSelectColumns($c); $startcol6 = $startcol5 + (NagiosServicePeer::NUM_COLUMNS - NagiosServicePeer::NUM_LAZY_LOAD_COLUMNS); NagiosHostgroupPeer::addSelectColumns($c); $startcol7 = $startcol6 + (NagiosHostgroupPeer::NUM_COLUMNS - NagiosHostgroupPeer::NUM_LAZY_LOAD_COLUMNS); $c->addJoin(array(NagiosEscalationPeer::HOST_TEMPLATE), array(NagiosHostTemplatePeer::ID), $join_behavior); $c->addJoin(array(NagiosEscalationPeer::HOST), array(NagiosHostPeer::ID), $join_behavior); $c->addJoin(array(NagiosEscalationPeer::SERVICE_TEMPLATE), array(NagiosServiceTemplatePeer::ID), $join_behavior); $c->addJoin(array(NagiosEscalationPeer::SERVICE), array(NagiosServicePeer::ID), $join_behavior); $c->addJoin(array(NagiosEscalationPeer::HOSTGROUP), array(NagiosHostgroupPeer::ID), $join_behavior); $stmt = BasePeer::doSelect($c, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = NagiosEscalationPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = NagiosEscalationPeer::getInstanceFromPool($key1))) { // We no longer rehydrate the object, since this can cause data loss. // See http://propel.phpdb.org/trac/ticket/509 // $obj1->hydrate($row, 0, true); // rehydrate } else { $omClass = NagiosEscalationPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj1 = new $cls(); $obj1->hydrate($row); NagiosEscalationPeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded // Add objects for joined NagiosHostTemplate rows $key2 = NagiosHostTemplatePeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = NagiosHostTemplatePeer::getInstanceFromPool($key2); if (!$obj2) { $omClass = NagiosHostTemplatePeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); NagiosHostTemplatePeer::addInstanceToPool($obj2, $key2); } // if $obj2 already loaded // Add the $obj1 (NagiosEscalation) to the collection in $obj2 (NagiosHostTemplate) $obj2->addNagiosEscalation($obj1); } // if joined row is not null // Add objects for joined NagiosHost rows $key3 = NagiosHostPeer::getPrimaryKeyHashFromRow($row, $startcol3); if ($key3 !== null) { $obj3 = NagiosHostPeer::getInstanceFromPool($key3); if (!$obj3) { $omClass = NagiosHostPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj3 = new $cls(); $obj3->hydrate($row, $startcol3); NagiosHostPeer::addInstanceToPool($obj3, $key3); } // if $obj3 already loaded // Add the $obj1 (NagiosEscalation) to the collection in $obj3 (NagiosHost) $obj3->addNagiosEscalation($obj1); } // if joined row is not null // Add objects for joined NagiosServiceTemplate rows $key4 = NagiosServiceTemplatePeer::getPrimaryKeyHashFromRow($row, $startcol4); if ($key4 !== null) { $obj4 = NagiosServiceTemplatePeer::getInstanceFromPool($key4); if (!$obj4) { $omClass = NagiosServiceTemplatePeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj4 = new $cls(); $obj4->hydrate($row, $startcol4); NagiosServiceTemplatePeer::addInstanceToPool($obj4, $key4); } // if $obj4 already loaded // Add the $obj1 (NagiosEscalation) to the collection in $obj4 (NagiosServiceTemplate) $obj4->addNagiosEscalation($obj1); } // if joined row is not null // Add objects for joined NagiosService rows $key5 = NagiosServicePeer::getPrimaryKeyHashFromRow($row, $startcol5); if ($key5 !== null) { $obj5 = NagiosServicePeer::getInstanceFromPool($key5); if (!$obj5) { $omClass = NagiosServicePeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj5 = new $cls(); $obj5->hydrate($row, $startcol5); NagiosServicePeer::addInstanceToPool($obj5, $key5); } // if $obj5 already loaded // Add the $obj1 (NagiosEscalation) to the collection in $obj5 (NagiosService) $obj5->addNagiosEscalation($obj1); } // if joined row is not null // Add objects for joined NagiosHostgroup rows $key6 = NagiosHostgroupPeer::getPrimaryKeyHashFromRow($row, $startcol6); if ($key6 !== null) { $obj6 = NagiosHostgroupPeer::getInstanceFromPool($key6); if (!$obj6) { $omClass = NagiosHostgroupPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj6 = new $cls(); $obj6->hydrate($row, $startcol6); NagiosHostgroupPeer::addInstanceToPool($obj6, $key6); } // if $obj6 already loaded // Add the $obj1 (NagiosEscalation) to the collection in $obj6 (NagiosHostgroup) $obj6->addNagiosEscalation($obj1); } // if joined row is not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }
/** * Selects a collection of ExamCommentDig objects pre-filled with all related objects. * * @param Criteria $c * @param PropelPDO $con * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @return array Array of ExamCommentDig objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAll(Criteria $c, $con = null, $join_behavior = Criteria::LEFT_JOIN) { foreach (sfMixer::getCallables('BaseExamCommentDigPeer:doSelectJoinAll:doSelectJoinAll') as $callable) { call_user_func($callable, 'BaseExamCommentDigPeer', $c, $con); } $c = clone $c; // Set the correct dbName if it has not been overridden if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } ExamCommentDigPeer::addSelectColumns($c); $startcol2 = ExamCommentDigPeer::NUM_COLUMNS - ExamCommentDigPeer::NUM_LAZY_LOAD_COLUMNS; ExamCommentPeer::addSelectColumns($c); $startcol3 = $startcol2 + (ExamCommentPeer::NUM_COLUMNS - ExamCommentPeer::NUM_LAZY_LOAD_COLUMNS); $c->addJoin(array(ExamCommentDigPeer::COMMENT_ID), array(ExamCommentPeer::ID), $join_behavior); $stmt = BasePeer::doSelect($c, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = ExamCommentDigPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = ExamCommentDigPeer::getInstanceFromPool($key1))) { // We no longer rehydrate the object, since this can cause data loss. // See http://propel.phpdb.org/trac/ticket/509 // $obj1->hydrate($row, 0, true); // rehydrate } else { $omClass = ExamCommentDigPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj1 = new $cls(); $obj1->hydrate($row); ExamCommentDigPeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded // Add objects for joined ExamComment rows $key2 = ExamCommentPeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = ExamCommentPeer::getInstanceFromPool($key2); if (!$obj2) { $omClass = ExamCommentPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); ExamCommentPeer::addInstanceToPool($obj2, $key2); } // if obj2 loaded // Add the $obj1 (ExamCommentDig) to the collection in $obj2 (ExamComment) $obj2->addExamCommentDig($obj1); } // if joined row not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }
public static function doSelectJoinAllExceptBankAccount(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } VAcademicCostTaPeer::addSelectColumns($c); $startcol2 = VAcademicCostTaPeer::NUM_COLUMNS - VAcademicCostTaPeer::NUM_LAZY_LOAD_COLUMNS + 1; AcademicCalendarPeer::addSelectColumns($c); $startcol3 = $startcol2 + AcademicCalendarPeer::NUM_COLUMNS; AcademicCostComponentPeer::addSelectColumns($c); $startcol4 = $startcol3 + AcademicCostComponentPeer::NUM_COLUMNS; AcademicProcessPeer::addSelectColumns($c); $startcol5 = $startcol4 + AcademicProcessPeer::NUM_COLUMNS; $c->addJoin(VAcademicCostTaPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID); $c->addJoin(VAcademicCostTaPeer::ACADEMIC_COST_COMPONENT_ID, AcademicCostComponentPeer::ID); $c->addJoin(VAcademicCostTaPeer::ACADEMIC_PROCESS_ID, AcademicProcessPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = VAcademicCostTaPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = AcademicCalendarPeer::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->getAcademicCalendar(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addVAcademicCostTa($obj1); break; } } if ($newObject) { $obj2->initVAcademicCostTas(); $obj2->addVAcademicCostTa($obj1); } $omClass = AcademicCostComponentPeer::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->getAcademicCostComponent(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addVAcademicCostTa($obj1); break; } } if ($newObject) { $obj3->initVAcademicCostTas(); $obj3->addVAcademicCostTa($obj1); } $omClass = AcademicProcessPeer::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->getAcademicProcess(); if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) { $newObject = false; $temp_obj4->addVAcademicCostTa($obj1); break; } } if ($newObject) { $obj4->initVAcademicCostTas(); $obj4->addVAcademicCostTa($obj1); } $results[] = $obj1; } return $results; }