selectRow( array( 'echo_email_batch' ), array( 'eeb_event_id' ), array( 'eeb_user_id' => $this->mUser->getId(), 'eeb_event_hash' => $this->bundleHash ), __METHOD__, array( 'ORDER BY' => 'eeb_event_priority DESC, eeb_id DESC', 'LIMIT' => 1 ) ); if ( !$res ) { return false; } $this->baseEvent = EchoEvent::newFromId( $res->eeb_event_id ); return true; } /** * Clear processed events from the queue */ protected function clearProcessedEvent() { if ( !$this->baseEvent ) { return; } $conds = array( 'eeb_user_id' => $this->mUser->getId(), 'eeb_event_hash' => $this->bundleHash ); $conds[] = 'eeb_event_id <= ' . intval( $this->baseEvent->getId() ); $dbw = MWEchoDbFactory::getDB( DB_MASTER ); $dbw->delete( 'echo_email_batch', $conds, __METHOD__, array() ); } }