_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`', [ 'customerFirstName' => 'firstName', 'customerLastName' => 'lastName', 'customerEmail' => 'email', ] ); $select->join( $this->_getPair('DGiftCardStatus'), '`DGiftCardStatus`.`id` = `' . $this->_tableAlias . '`.`statusId`', ['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`', ['userFirstName' => 'firstName', 'userLastName' => 'lastName'] ); return $select; } public function getObjectInfo() { static $data; if (null === $data) { $this->clearData(); if (!($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; } }