_select) { return $this->_select; } $select = parent::getListSelect(); $this->_joinPaymentType($select); $this->_joinCreatedBy($select); $this->_joinOrder($select); return $select; } protected function _filter(Zend_Db_Select $select) { $select->where('`ea`.`status` = ?', AttendeeEntity::STATUS_ATTENDED); return parent::_filter($select); } protected function _joinPaymentType(Zend_Db_Select $select) { $select->joinLeft( $this->_getPair('PaymentType', 'pt'), '`pt`.`id` = `ea`.`paymentType`', ['paymentTypeTitle' => 'title'] ); return $this; } protected function _joinOrder(Zend_Db_Select $select) { $select->joinLeft( $this->_getPair('Cart', 'cart'), '`cart`.`id` = `ea`.`cartId`', ['orderId' => 'transactionId'] ); return $this; } protected function _joinCreatedBy(Zend_Db_Select $select) { $createdByTitle = Qs_String::fill( 'IF(`ea`.`createdBy` = {anotherMember}, {expr}, `eacb`.`title`)', [ 'anotherMember' => $this->_db->quote(AttendeeEntity::CREATED_BY_ANOTHER_MEMBER), 'expr' => 'CONCAT(`eacb`.`title`, " (", `ea`.`createdByName`, ")")', ] ); $select->joinLeft( $this->_getPair('EventAttendeeCreatedBy', 'eacb'), '`eacb`.`id` = `ea`.`createdBy`', compact('createdByTitle') ); return $this; } }