ContactQuery: Rename baseQuery to select

This commit is contained in:
Eric Lippmann 2014-04-15 17:56:31 +02:00
parent c2d633ac49
commit 22fa833836
1 changed files with 6 additions and 8 deletions

View File

@ -45,22 +45,20 @@ class ContactQuery extends IdoQuery
protected function joinBaseTables() protected function joinBaseTables()
{ {
$this->baseQuery = $this->db->select()->from( $this->select->from(
array('c' => $this->prefix . 'contacts'), array('c' => $this->prefix . 'contacts'),
array() array()
)->join( )->join(
array('co' => $this->prefix . 'objects'), array('co' => $this->prefix . 'objects'),
'c.contact_object_id = co.' . $this->object_id 'c.contact_object_id = co.' . $this->object_id . ' AND co.is_active = 1',
. ' AND co.is_active = 1',
array() array()
); );
$this->joinedVirtualTables = array('contacts' => true); $this->joinedVirtualTables = array('contacts' => true);
} }
protected function joinHosts() protected function joinHosts()
{ {
$this->baseQuery->join( $this->select->join(
array('hc' => $this->prefix . 'host_contacts'), array('hc' => $this->prefix . 'host_contacts'),
'hc.contact_object_id = c.contact_object_id', 'hc.contact_object_id = c.contact_object_id',
array() array()
@ -77,7 +75,7 @@ class ContactQuery extends IdoQuery
protected function joinServices() protected function joinServices()
{ {
$this->baseQuery->join( $this->select->join(
array('sc' => $this->prefix . 'service_contacts'), array('sc' => $this->prefix . 'service_contacts'),
'sc.contact_object_id = c.contact_object_id', 'sc.contact_object_id = c.contact_object_id',
array() array()
@ -94,12 +92,12 @@ class ContactQuery extends IdoQuery
protected function joinTimeperiods() protected function joinTimeperiods()
{ {
$this->baseQuery->join( $this->select->join(
array('ht' => $this->prefix . 'timeperiods'), array('ht' => $this->prefix . 'timeperiods'),
'ht.timeperiod_object_id = c.host_timeperiod_object_id', 'ht.timeperiod_object_id = c.host_timeperiod_object_id',
array() array()
); );
$this->baseQuery->join( $this->select->join(
array('st' => $this->prefix . 'timeperiods'), array('st' => $this->prefix . 'timeperiods'),
'st.timeperiod_object_id = c.service_timeperiod_object_id', 'st.timeperiod_object_id = c.service_timeperiod_object_id',
array() array()