Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions classes/NagiosHostPeer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ static public function getByName($name) {
return $host;
}

static public function getById($id) {
$c = new Criteria();
$c->add(NagiosHostPeer::ID, $id);
//$c->setIgnoreCase(true);
$host = NagiosHostPeer::doSelectOne($c);
if(!$host)
return false;

return $host;
}

static 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";
Expand Down