root/trunk/models/NpcServices.php @ 117

Revision 117, 1.7 KB (checked in by divagater, 5 years ago)

Added graph icon and handling for mapped graphs. Only implemented on the service list so far

Line 
1<?php
2/**
3 * NpcServices class
4 *
5 * This is the access point to the npc_services table
6 *
7 * @filesource
8 * @author              Billy Gunn <billy@gunn.org>
9 * @copyright           Copyright (c) 2007
10 * @link                http://trac2.assembla.com/npc
11 * @package             npc
12 * @subpackage          npc.models
13 * @since               NPC 2.0
14 * @version             $Id: $
15 */
16
17/**
18 * NpcServices class
19 *
20 * NpcServices class handles mapping the table associations.
21 *
22 * @package     npc
23 * @subpackage  npc.models
24 */
25class NpcServices extends BaseNpcServices
26{
27
28    public function setUp()
29    {
30
31        $this->hasOne('NpcObjects as Object', array('local' => 'service_object_id', 'foreign' => 'object_id'));
32        $this->hasOne('NpcInstances as Instance', array('local' => 'instance_id', 'foreign' => 'instance_id'));
33        $this->hasOne('NpcHosts as Host', array('local' => 'host_object_id', 'foreign' => 'host_object_id'));
34        $this->hasOne('NpcHoststatus as Hoststatus', array('local' => 'host_object_id', 'foreign' => 'host_object_id'));
35        $this->hasOne('NpcServicestatus as Status', array('local' => 'service_object_id', 'foreign' => 'service_object_id'));
36        $this->hasOne('NpcServiceGraphs as Graph', array('local' => 'service_object_id', 'foreign' => 'service_object_id'));
37        $this->hasMany('NpcComments as Comment', array('local' => 'service_object_id', 'foreign' => 'object_id'));
38        $this->hasMany('NpcServicechecks as Check', array('local' => 'service_object_id', 'foreign' => 'service_object_id'));
39        $this->hasMany('NpcServicegroups as Groups', array('local' => 'service_object_id', 'foreign' => 'servicegroup_id', 'refClass' => 'NpcServicegroupMembers'));
40    }
41
42
43}
Note: See TracBrowser for help on using the browser.