_select) { return $this->_select; } $select = parent::getListSelect(); $select->join( $this->_getPair('LicenseNaics', 'ln'), '`ln`.`licenseId` = `l`.`id`', ['naicsCode'] ); $select->join( $this->_getPair('Vendor', 'v'), '`v`.`id` = `l`.`vendorId`', ['dbaName', 'businessName', 'phone'] ); return $select; } protected function _filter(Zend_Db_Select $select) { parent::_filter($select); if (!empty($this->_filter['naicsCode'])) { $select->where('`ln`.`naicsCode` = ?', $this->_filter['naicsCode']); } return $this; } public function getNaicsCodeData($code, $field = null) { return $this->_getTable('Naics')->searchBy(['id' => $code], $field); } }