NotificationQuery: Rename baseQuery to select

This commit is contained in:
Eric Lippmann 2014-04-15 18:09:08 +02:00
parent 687fa09f7c
commit 0adbb6a44e

View File

@ -62,10 +62,8 @@ class NotificationQuery extends IdoQuery
*/ */
protected function joinBaseTables() protected function joinBaseTables()
{ {
$this->baseQuery = $this->db->select()->from( $this->select->from(
array( array('n' => $this->prefix . 'notifications'),
'n' => $this->prefix . 'notifications'
),
array() array()
); );
$this->joinedVirtualTables = array('notification' => true); $this->joinedVirtualTables = array('notification' => true);
@ -76,10 +74,8 @@ class NotificationQuery extends IdoQuery
*/ */
protected function joinObjects() protected function joinObjects()
{ {
$this->baseQuery->join( $this->select->join(
array( array('o' => $this->prefix . 'objects'),
'o' => $this->prefix . 'objects'
),
'n.object_id = o.object_id AND o.is_active = 1 AND o.objecttype_id IN (1, 2)', 'n.object_id = o.object_id AND o.is_active = 1 AND o.objecttype_id IN (1, 2)',
array() array()
); );
@ -90,17 +86,13 @@ class NotificationQuery extends IdoQuery
*/ */
protected function joinContact() protected function joinContact()
{ {
$this->baseQuery->join( $this->select->join(
array( array('c' => $this->prefix . 'contactnotifications'),
'c' => $this->prefix . 'contactnotifications'
),
'n.notification_id = c.notification_id', 'n.notification_id = c.notification_id',
array() array()
); );
$this->baseQuery->join( $this->select->join(
array( array('c_o' => $this->prefix . 'objects'),
'c_o' => $this->prefix . 'objects'
),
'c.contact_object_id = c_o.object_id', 'c.contact_object_id = c_o.object_id',
array() array()
); );
@ -111,24 +103,18 @@ class NotificationQuery extends IdoQuery
*/ */
protected function joinCommand() protected function joinCommand()
{ {
$this->baseQuery->join( $this->select->join(
array( array('cmd_c' => $this->prefix . 'contactnotifications'),
'cmd_c' => $this->prefix . 'contactnotifications'
),
'n.notification_id = cmd_c.notification_id', 'n.notification_id = cmd_c.notification_id',
array() array()
); );
$this->baseQuery->joinLeft( $this->select->joinLeft(
array( array('cmd_m' => $this->prefix . 'contactnotificationmethods'),
'cmd_m' => $this->prefix . 'contactnotificationmethods'
),
'cmd_c.contactnotification_id = cmd_m.contactnotification_id', 'cmd_c.contactnotification_id = cmd_m.contactnotification_id',
array() array()
); );
$this->baseQuery->joinLeft( $this->select->joinLeft(
array( array('cmd_o' => $this->prefix . 'objects'),
'cmd_o' => $this->prefix . 'objects'
),
'cmd_m.command_object_id = cmd_o.object_id', 'cmd_m.command_object_id = cmd_o.object_id',
array() array()
); );