/** * Selects a collection of NagiosMainConfiguration 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 NagiosMainConfiguration 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) { $c = clone $c; // Set the correct dbName if it has not been overridden if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } NagiosMainConfigurationPeer::addSelectColumns($c); $startcol2 = NagiosMainConfigurationPeer::NUM_COLUMNS - NagiosMainConfigurationPeer::NUM_LAZY_LOAD_COLUMNS; NagiosCommandPeer::addSelectColumns($c); $startcol3 = $startcol2 + (NagiosCommandPeer::NUM_COLUMNS - NagiosCommandPeer::NUM_LAZY_LOAD_COLUMNS); NagiosCommandPeer::addSelectColumns($c); $startcol4 = $startcol3 + (NagiosCommandPeer::NUM_COLUMNS - NagiosCommandPeer::NUM_LAZY_LOAD_COLUMNS); NagiosCommandPeer::addSelectColumns($c); $startcol5 = $startcol4 + (NagiosCommandPeer::NUM_COLUMNS - NagiosCommandPeer::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); NagiosCommandPeer::addSelectColumns($c); $startcol8 = $startcol7 + (NagiosCommandPeer::NUM_COLUMNS - NagiosCommandPeer::NUM_LAZY_LOAD_COLUMNS); NagiosCommandPeer::addSelectColumns($c); $startcol9 = $startcol8 + (NagiosCommandPeer::NUM_COLUMNS - NagiosCommandPeer::NUM_LAZY_LOAD_COLUMNS); NagiosCommandPeer::addSelectColumns($c); $startcol10 = $startcol9 + (NagiosCommandPeer::NUM_COLUMNS - NagiosCommandPeer::NUM_LAZY_LOAD_COLUMNS); $c->addJoin(array(NagiosMainConfigurationPeer::OCSP_COMMAND), array(NagiosCommandPeer::ID), $join_behavior); $c->addJoin(array(NagiosMainConfigurationPeer::OCHP_COMMAND), array(NagiosCommandPeer::ID), $join_behavior); $c->addJoin(array(NagiosMainConfigurationPeer::HOST_PERFDATA_COMMAND), array(NagiosCommandPeer::ID), $join_behavior); $c->addJoin(array(NagiosMainConfigurationPeer::SERVICE_PERFDATA_COMMAND), array(NagiosCommandPeer::ID), $join_behavior); $c->addJoin(array(NagiosMainConfigurationPeer::HOST_PERFDATA_FILE_PROCESSING_COMMAND), array(NagiosCommandPeer::ID), $join_behavior); $c->addJoin(array(NagiosMainConfigurationPeer::SERVICE_PERFDATA_FILE_PROCESSING_COMMAND), array(NagiosCommandPeer::ID), $join_behavior); $c->addJoin(array(NagiosMainConfigurationPeer::GLOBAL_SERVICE_EVENT_HANDLER), array(NagiosCommandPeer::ID), $join_behavior); $c->addJoin(array(NagiosMainConfigurationPeer::GLOBAL_HOST_EVENT_HANDLER), array(NagiosCommandPeer::ID), $join_behavior); $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 // Add objects for joined NagiosCommand rows $key2 = NagiosCommandPeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = NagiosCommandPeer::getInstanceFromPool($key2); if (!$obj2) { $omClass = NagiosCommandPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); NagiosCommandPeer::addInstanceToPool($obj2, $key2); } // if obj2 loaded // Add the $obj1 (NagiosMainConfiguration) to the collection in $obj2 (NagiosCommand) $obj2->addNagiosMainConfigurationRelatedByOcspCommand($obj1); } // if joined row not null // Add objects for joined NagiosCommand rows $key3 = NagiosCommandPeer::getPrimaryKeyHashFromRow($row, $startcol3); if ($key3 !== null) { $obj3 = NagiosCommandPeer::getInstanceFromPool($key3); if (!$obj3) { $omClass = NagiosCommandPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj3 = new $cls(); $obj3->hydrate($row, $startcol3); NagiosCommandPeer::addInstanceToPool($obj3, $key3); } // if obj3 loaded // Add the $obj1 (NagiosMainConfiguration) to the collection in $obj3 (NagiosCommand) $obj3->addNagiosMainConfigurationRelatedByOchpCommand($obj1); } // if joined row not null // Add objects for joined NagiosCommand rows $key4 = NagiosCommandPeer::getPrimaryKeyHashFromRow($row, $startcol4); if ($key4 !== null) { $obj4 = NagiosCommandPeer::getInstanceFromPool($key4); if (!$obj4) { $omClass = NagiosCommandPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj4 = new $cls(); $obj4->hydrate($row, $startcol4); NagiosCommandPeer::addInstanceToPool($obj4, $key4); } // if obj4 loaded // Add the $obj1 (NagiosMainConfiguration) to the collection in $obj4 (NagiosCommand) $obj4->addNagiosMainConfigurationRelatedByHostPerfdataCommand($obj1); } // if joined row 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 loaded // Add the $obj1 (NagiosMainConfiguration) to the collection in $obj5 (NagiosCommand) $obj5->addNagiosMainConfigurationRelatedByServicePerfdataCommand($obj1); } // if joined row 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 loaded // Add the $obj1 (NagiosMainConfiguration) to the collection in $obj6 (NagiosCommand) $obj6->addNagiosMainConfigurationRelatedByHostPerfdataFileProcessingCommand($obj1); } // if joined row not null // Add objects for joined NagiosCommand rows $key7 = NagiosCommandPeer::getPrimaryKeyHashFromRow($row, $startcol7); if ($key7 !== null) { $obj7 = NagiosCommandPeer::getInstanceFromPool($key7); if (!$obj7) { $omClass = NagiosCommandPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj7 = new $cls(); $obj7->hydrate($row, $startcol7); NagiosCommandPeer::addInstanceToPool($obj7, $key7); } // if obj7 loaded // Add the $obj1 (NagiosMainConfiguration) to the collection in $obj7 (NagiosCommand) $obj7->addNagiosMainConfigurationRelatedByServicePerfdataFileProcessingCommand($obj1); } // if joined row not null // Add objects for joined NagiosCommand rows $key8 = NagiosCommandPeer::getPrimaryKeyHashFromRow($row, $startcol8); if ($key8 !== null) { $obj8 = NagiosCommandPeer::getInstanceFromPool($key8); if (!$obj8) { $omClass = NagiosCommandPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj8 = new $cls(); $obj8->hydrate($row, $startcol8); NagiosCommandPeer::addInstanceToPool($obj8, $key8); } // if obj8 loaded // Add the $obj1 (NagiosMainConfiguration) to the collection in $obj8 (NagiosCommand) $obj8->addNagiosMainConfigurationRelatedByGlobalServiceEventHandler($obj1); } // if joined row not null // Add objects for joined NagiosCommand rows $key9 = NagiosCommandPeer::getPrimaryKeyHashFromRow($row, $startcol9); if ($key9 !== null) { $obj9 = NagiosCommandPeer::getInstanceFromPool($key9); if (!$obj9) { $omClass = NagiosCommandPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj9 = new $cls(); $obj9->hydrate($row, $startcol9); NagiosCommandPeer::addInstanceToPool($obj9, $key9); } // if obj9 loaded // Add the $obj1 (NagiosMainConfiguration) to the collection in $obj9 (NagiosCommand) $obj9->addNagiosMainConfigurationRelatedByGlobalHostEventHandler($obj1); } // if joined row not null $results[] = $obj1; } $stmt->closeCursor(); return $results; }
/** * Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement. * * Use this method directly if you want to work with an executed statement durirectly (for example * to perform your own object hydration). * * @param Criteria $criteria The Criteria object used to build the SELECT statement. * @param PropelPDO $con The connection to use * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. * @return PDOStatement The executed PDOStatement object. * @see BasePeer::doSelect() */ public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null) { if ($con === null) { $con = Propel::getConnection(NagiosCommandPeer::DATABASE_NAME, Propel::CONNECTION_READ); } if (!$criteria->hasSelectClause()) { $criteria = clone $criteria; NagiosCommandPeer::addSelectColumns($criteria); } // Set the correct dbName $criteria->setDbName(self::DATABASE_NAME); // BasePeer returns a PDOStatement return BasePeer::doSelect($criteria, $con); }
/** * Selects a collection of NagiosContactNotificationCommand objects pre-filled with all related objects except NagiosContact. * * @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 NagiosContactNotificationCommand objects. * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function doSelectJoinAllExceptNagiosContact(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); } NagiosContactNotificationCommandPeer::addSelectColumns($c); $startcol2 = NagiosContactNotificationCommandPeer::NUM_COLUMNS - NagiosContactNotificationCommandPeer::NUM_LAZY_LOAD_COLUMNS; NagiosCommandPeer::addSelectColumns($c); $startcol3 = $startcol2 + (NagiosCommandPeer::NUM_COLUMNS - NagiosCommandPeer::NUM_LAZY_LOAD_COLUMNS); $c->addJoin(array(NagiosContactNotificationCommandPeer::COMMAND), array(NagiosCommandPeer::ID), $join_behavior); $stmt = BasePeer::doSelect($c, $con); $results = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key1 = NagiosContactNotificationCommandPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj1 = NagiosContactNotificationCommandPeer::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 = NagiosContactNotificationCommandPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj1 = new $cls(); $obj1->hydrate($row); NagiosContactNotificationCommandPeer::addInstanceToPool($obj1, $key1); } // if obj1 already loaded // Add objects for joined NagiosCommand rows $key2 = NagiosCommandPeer::getPrimaryKeyHashFromRow($row, $startcol2); if ($key2 !== null) { $obj2 = NagiosCommandPeer::getInstanceFromPool($key2); if (!$obj2) { $omClass = NagiosCommandPeer::getOMClass(); $cls = substr('.' . $omClass, strrpos('.' . $omClass, '.') + 1); $obj2 = new $cls(); $obj2->hydrate($row, $startcol2); NagiosCommandPeer::addInstanceToPool($obj2, $key2); } // if $obj2 already loaded // Add the $obj1 (NagiosContactNotificationCommand) to the collection in $obj2 (NagiosCommand) $obj2->addNagiosContactNotificationCommand($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; }