/** * Selects a collection of NagiosServiceContactGroupMember objects pre-filled with all related objects except NagiosContactGroup. * * @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 NagiosServiceContactGroupMember objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAllExceptNagiosContactGroup(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); } NagiosServiceContactGroupMemberPeer::addSelectColumns($c); $startcol2 = NagiosServiceContactGroupMemberPeer::NUM_COLUMNS - NagiosServiceContactGroupMemberPeer::NUM_LAZY_LOAD_COLUMNS; NagiosServicePeer::addSelectColumns($c); $startcol3 = $startcol2 + (NagiosServicePeer::NUM_COLUMNS - NagiosServicePeer::NUM_LAZY_LOAD_COLUMNS); NagiosServiceTemplatePeer::addSelectColumns($c); $startcol4 = $startcol3 + (NagiosServiceTemplatePeer::NUM_COLUMNS - NagiosServiceTemplatePeer::NUM_LAZY_LOAD_COLUMNS); $c->addJoin(array(NagiosServiceContactGroupMemberPeer::SERVICE), array(NagiosServicePeer::ID), $join_behavior); $c->addJoin(array(NagiosServiceContactGroupMemberPeer::TEMPLATE), array(NagiosServiceTemplatePeer::ID), $join_behavior); $stmt = BasePeer::doSelect($c, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = NagiosServiceContactGroupMemberPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = NagiosServiceContactGroupMemberPeer::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 = NagiosServiceContactGroupMemberPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj1 = new $cls(); $obj1->hydrate($row); NagiosServiceContactGroupMemberPeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded // Add objects for joined NagiosService rows $key2 = NagiosServicePeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = NagiosServicePeer::getInstanceFromPool($key2); if (!$obj2) { $omClass = NagiosServicePeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); NagiosServicePeer::addInstanceToPool($obj2, $key2); } // if $obj2 already loaded // Add the $obj1 (NagiosServiceContactGroupMember) to the collection in $obj2 (NagiosService) $obj2->addNagiosServiceContactGroupMember($obj1); } // if joined row is not null // Add objects for joined NagiosServiceTemplate rows $key3 = NagiosServiceTemplatePeer::getPrimaryKeyHashFromRow($row, $startcol3); if ($key3 !== null) { $obj3 = NagiosServiceTemplatePeer::getInstanceFromPool($key3); if (!$obj3) { $omClass = NagiosServiceTemplatePeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj3 = new $cls(); $obj3->hydrate($row, $startcol3); NagiosServiceTemplatePeer::addInstanceToPool($obj3, $key3); } // if $obj3 already loaded // Add the $obj1 (NagiosServiceContactGroupMember) to the collection in $obj3 (NagiosServiceTemplate) $obj3->addNagiosServiceContactGroupMember($obj1); } // if joined row is not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }
/** * Selects a collection of NagiosService objects pre-filled with all related objects except NagiosTimeperiodRelatedByNotificationPeriod. * * @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 NagiosService objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAllExceptNagiosTimeperiodRelatedByNotificationPeriod(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); } NagiosServicePeer::addSelectColumns($c); $startcol2 = NagiosServicePeer::NUM_COLUMNS - NagiosServicePeer::NUM_LAZY_LOAD_COLUMNS; NagiosHostPeer::addSelectColumns($c); $startcol3 = $startcol2 + (NagiosHostPeer::NUM_COLUMNS - NagiosHostPeer::NUM_LAZY_LOAD_COLUMNS); NagiosHostTemplatePeer::addSelectColumns($c); $startcol4 = $startcol3 + (NagiosHostTemplatePeer::NUM_COLUMNS - NagiosHostTemplatePeer::NUM_LAZY_LOAD_COLUMNS); NagiosHostgroupPeer::addSelectColumns($c); $startcol5 = $startcol4 + (NagiosHostgroupPeer::NUM_COLUMNS - NagiosHostgroupPeer::NUM_LAZY_LOAD_COLUMNS); NagiosCommandPeer::addSelectColumns($c); $startcol6 = $startcol5 + (NagiosCommandPeer::NUM_COLUMNS - NagiosCommandPeer::NUM_LAZY_LOAD_COLUMNS); NagiosCommandPeer::addSelectColumns($c); $startcol7 = $startcol6 + (NagiosCommandPeer::NUM_COLUMNS - NagiosCommandPeer::NUM_LAZY_LOAD_COLUMNS); $c->addJoin(array(NagiosServicePeer::HOST), array(NagiosHostPeer::ID), $join_behavior); $c->addJoin(array(NagiosServicePeer::HOST_TEMPLATE), array(NagiosHostTemplatePeer::ID), $join_behavior); $c->addJoin(array(NagiosServicePeer::HOSTGROUP), array(NagiosHostgroupPeer::ID), $join_behavior); $c->addJoin(array(NagiosServicePeer::CHECK_COMMAND), array(NagiosCommandPeer::ID), $join_behavior); $c->addJoin(array(NagiosServicePeer::EVENT_HANDLER), array(NagiosCommandPeer::ID), $join_behavior); $stmt = BasePeer::doSelect($c, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = NagiosServicePeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = NagiosServicePeer::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 = NagiosServicePeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj1 = new $cls(); $obj1->hydrate($row); NagiosServicePeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded // Add objects for joined NagiosHost rows $key2 = NagiosHostPeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = NagiosHostPeer::getInstanceFromPool($key2); if (!$obj2) { $omClass = NagiosHostPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); NagiosHostPeer::addInstanceToPool($obj2, $key2); } // if $obj2 already loaded // Add the $obj1 (NagiosService) to the collection in $obj2 (NagiosHost) $obj2->addNagiosService($obj1); } // if joined row is not null // Add objects for joined NagiosHostTemplate rows $key3 = NagiosHostTemplatePeer::getPrimaryKeyHashFromRow($row, $startcol3); if ($key3 !== null) { $obj3 = NagiosHostTemplatePeer::getInstanceFromPool($key3); if (!$obj3) { $omClass = NagiosHostTemplatePeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj3 = new $cls(); $obj3->hydrate($row, $startcol3); NagiosHostTemplatePeer::addInstanceToPool($obj3, $key3); } // if $obj3 already loaded // Add the $obj1 (NagiosService) to the collection in $obj3 (NagiosHostTemplate) $obj3->addNagiosService($obj1); } // if joined row is not null // Add objects for joined NagiosHostgroup rows $key4 = NagiosHostgroupPeer::getPrimaryKeyHashFromRow($row, $startcol4); if ($key4 !== null) { $obj4 = NagiosHostgroupPeer::getInstanceFromPool($key4); if (!$obj4) { $omClass = NagiosHostgroupPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj4 = new $cls(); $obj4->hydrate($row, $startcol4); NagiosHostgroupPeer::addInstanceToPool($obj4, $key4); } // if $obj4 already loaded // Add the $obj1 (NagiosService) to the collection in $obj4 (NagiosHostgroup) $obj4->addNagiosService($obj1); } // if joined row is not null // Add objects for joined NagiosCommand rows $key5 = NagiosCommandPeer::getPrimaryKeyHashFromRow($row, $startcol5); if ($key5 !== null) { $obj5 = NagiosCommandPeer::getInstanceFromPool($key5); if (!$obj5) { $omClass = NagiosCommandPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj5 = new $cls(); $obj5->hydrate($row, $startcol5); NagiosCommandPeer::addInstanceToPool($obj5, $key5); } // if $obj5 already loaded // Add the $obj1 (NagiosService) to the collection in $obj5 (NagiosCommand) $obj5->addNagiosServiceRelatedByCheckCommand($obj1); } // if joined row is not null // Add objects for joined NagiosCommand rows $key6 = NagiosCommandPeer::getPrimaryKeyHashFromRow($row, $startcol6); if ($key6 !== null) { $obj6 = NagiosCommandPeer::getInstanceFromPool($key6); if (!$obj6) { $omClass = NagiosCommandPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj6 = new $cls(); $obj6->hydrate($row, $startcol6); NagiosCommandPeer::addInstanceToPool($obj6, $key6); } // if $obj6 already loaded // Add the $obj1 (NagiosService) to the collection in $obj6 (NagiosCommand) $obj6->addNagiosServiceRelatedByEventHandler($obj1); } // if joined row is not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }