summaryrefslogtreecommitdiffstats
path: root/library/Monitoring/Backend/Ido/Query/HostdependencyQuery.php
blob: 1946cbb03cc884ba1f547a7043c25b6ecd9a10ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

namespace Icinga\Module\Monitoring\Backend\Ido\Query;

class HostdependencyQuery extends IdoQuery {

	protected $columnMap = array(
		'hostdependencies' => array(
			'host_name' => 'ho1.name1 COLLATE latin1_general_ci',
			'dependent_host_name' => 'ho2.name1 COLLATE latin1_general_ci',
		),
	);

	protected function joinBaseTables() {
		$this->select->from(
			array('hd' => $this->prefix . 'hostdependencies'),
			array()
		)->join(
			array('ho1' => $this->prefix . 'objects'),
			'ho1.object_id = hd.host_object_id',
			array()
		)->join(
			array('ho2' => $this->prefix . 'objects'),
			'ho2.object_id = hd.dependent_host_object_id',
			array()
		);
		$this->joinedVirtualTables['hostdependencies'] = true;
	}

}