_tribeId = $tribeId; return $this; } public function getTribeId() { return $this->_tribeId; } protected function _getFromDbSelect($primaryKey) { $select = parent::_getFromDbSelect($primaryKey); $select->join($this->_getPair('Vendor', 'v'), '`v`.`id` = `l`.`vendorId`', [ 'vendorDbaName' => 'dbaName', 'vendorBusinessName' => 'businessName', 'vendorSoleProprietorName' => $this->getVendorModel()->getSoleProprietorNameExpr(), 'preferredVendor', ]); if ($this->getTribeId()) { $this->getModel()->joinTribe($select, $this->getTribeId()); } $select->joinLeft($this->_getPair('User', 'u'), '`u`.`id` = `l`.`userId`', [ 'userEmail' => 'email', ]); return $select; } protected function _addDependenciesFromDb(array &$data) { $this->getVendorModel()->mapCollections($data); $data['vendorBillingAddress'] = $this->getVendorModel()->getBillingAddress(['vendorId' => $data['vendorId']]); $data['naicsCodes'] = $this->getModel()->getLicenseNaics($data['id']); $view = \Qs_View::getInstance(); $view->addHelperPath('App/Form/View/Helper/', 'App\Form\View\Helper\\'); $data['routingNumber'] = $view->maskRoutingNumber($data['routingNumber']); return $this; } }