getUserId(); $columns['showReceipt'] = new Zend_Db_Expr("`c`.`userId` = {$_userId}"); return $columns; } public function getListSelect() { if (null === $this->_select) { parent::getListSelect(); $this->_joinCurrentAttendee($this->_select); $this->_joinTransaction($this->_select); } return $this->_select; } protected function _joinCurrentAttendee(Zend_Db_Select $select) { $select->join( $this->_getPair('EventAttendee', 'ea'), '`ea`.`eventId` = `e`.`id` AND `ea`.`active` = "y" AND `ea`.`approved` = "y" ' . 'AND `ea`.`userId` = ' . (int) $this->getUserId(), array() ); return $this; } protected function _joinTransaction(Zend_Db_Select $select) { $select->join( $this->_getPair('Cart', 'c'), '`c`.`id` = `ea`.`cartId`', array() ); $select->join( $this->_getPair('Transaction', 't'), '`t`.`id` = `c`.`transactionId`', array('transactionId' => 'id', 'submittedDate' => 'added', 'paymentType', 'paymentTypeTitle') ); return $this; } public function setUserId($userId) { $this->_userId = $userId; return $this; } public function getUserId() { if (null === $this->_userId) { throw new Qs_Exception_EmptyPropertyException($this, '_userId'); } return $this->_userId; } }