_select) { parent::getListSelect(); $this->_join($this->_select); } return $this->_select; } protected function _join(Zend_Db_Select $select) { $select->join( $this->_getPair('User'), '`User`.`id` = `' . $this->_tableAlias . '`.`userId`', array( 'customerFirstName' => 'firstName', 'customerLastName' => 'lastName', 'customerEmail' => 'email' ) ); $select->join( $this->_getPair('DGiftCardStatus'), '`DGiftCardStatus`.`id` = `' . $this->_tableAlias . '`.`statusId`', array('statusTitle' => 'title') ); return $this; } protected function _getFromDbSelect($primaryKey) { $select = parent::_getFromDbSelect($primaryKey); $mainAlias = ($this->_tableShortAlias) ? $this->_tableShortAlias : $this->_tableAlias; $relatedAlias = ($this->_tableShortAlias) ? 'u' : 'User'; $select->joinLeft( $this->_getPair('User', $relatedAlias), '`' . $mainAlias . '`.`userId` = `' . $relatedAlias . '`.`id`', array('userFirstName' => 'firstName', 'userLastName' => 'lastName') ); return $select; } public function getObjectInfo() { if (null == ($data = parent::getObjectInfo())) { return $data; } $userName = 'Unknown User'; if (!empty($data['userFirstName']) || !empty($data['userFirstName'])) { $userName = $data['userFirstName'] . ' ' .$data['userLastName']; } $data['itemTitle'] = '$' . number_format($data['cardValue'], 2) . ' Gift Card for ' . $userName; return $data; } }