Exemple #1
0
 public function getTopLevelHosts()
 {
     $con = Propel::getConnection(BaseNagiosHostPeer::DATABASE_NAME);
     $sql = "SELECT * from nagios_host WHERE (select count(*) FROM nagios_host_parent WHERE nagios_host_parent.child_host = nagios_host.id) = 0 ORDER BY nagios_host.name";
     $stmt = $con->prepare($sql);
     $stmt->execute();
     $hosts = NagiosHostPeer::populateObjects($stmt);
     return $hosts;
 }
Exemple #2
0
 /**
  * Method to do selects.
  *
  * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
  * @param      PropelPDO $con
  * @return     array Array of selected Objects
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelect(Criteria $criteria, PropelPDO $con = null)
 {
     return NagiosHostPeer::populateObjects(NagiosHostPeer::doSelectStmt($criteria, $con));
 }
Exemple #3
0
 function getChildrenHosts()
 {
     $con = Propel::getConnection(NagiosHostPeer::DATABASE_NAME);
     $sql = "SELECT nagios_host.* FROM nagios_host_parent INNER JOIN nagios_host ON nagios_host.id = nagios_host_parent.child_host WHERE  nagios_host_parent.parent_host = " . $this->getId() . " ORDER BY nagios_host.name";
     $stmt = $con->prepare($sql);
     $stmt->execute();
     $children = NagiosHostPeer::populateObjects($stmt);
     return $children;
 }