From 7916c149b95b1eb886510798c25bdea5a77922eb Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 25 Aug 2015 16:32:27 +0200 Subject: [PATCH] ContactQuery: Add query column `instance_name' refs #9943 --- .../Monitoring/Backend/Ido/Query/ContactQuery.php | 15 +++++++++++++++ .../library/Monitoring/DataView/Contact.php | 1 + 2 files changed, 16 insertions(+) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php index cd72c4782..bd156e176 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php @@ -17,6 +17,9 @@ class ContactQuery extends IdoQuery * {@inheritdoc} */ protected $columnMap = array( + 'instances' => array( + 'instance_name' => 'i.instance_name' + ), 'contacts' => array( 'contact_id' => 'c.contact_id', 'contact' => 'co.name1 COLLATE latin1_general_ci', @@ -183,6 +186,18 @@ class ContactQuery extends IdoQuery ); } + /** + * Join instances + */ + protected function joinInstances() + { + $this->select->join( + array('i' => $this->prefix . 'instances'), + 'i.instance_id = c.instance_id', + array() + ); + } + /** * {@inheritdoc} */ diff --git a/modules/monitoring/library/Monitoring/DataView/Contact.php b/modules/monitoring/library/Monitoring/DataView/Contact.php index af8128f0e..5add208cd 100644 --- a/modules/monitoring/library/Monitoring/DataView/Contact.php +++ b/modules/monitoring/library/Monitoring/DataView/Contact.php @@ -11,6 +11,7 @@ class Contact extends DataView public function getColumns() { return array( + 'instance_name', 'contact_object_id', 'contact_id', 'contact_name',