protected function getMenuData() { if (!empty($this->record['id'])) { $this->pagePath = $this->dao->getRecordPath($this->record['id']); } else { $daoClass = $this->getDAOClass(); if ($daoClass == 'CompanyDAO') { $this->pagePath['companyName'] = 'New Comapny'; $this->pagePath['comanyId'] = 0; } elseif ($daoClass == 'ProjectDAO') { $comapanyId = CoreServices2::getRequest()->getFromGet('comp'); if (!empty($comapanyId)) { $companyDAO = new CompanyDAO(); $this->pagePath = $companyDAO->getRecordPath($comapanyId); } $this->pagePath['projectName'] = 'New Project'; $this->pagePath['projectId'] = 0; } elseif ($daoClass == 'SiteDAO') { $projectId = CoreServices2::getRequest()->getFromGet('proj'); if (!empty($projectId)) { $projectDAO = new ProjectDAO(); $this->pagePath = $projectDAO->getRecordPath($projectId); } $this->pagePath['siteName'] = 'New Site'; $this->pagePath['siteId'] = 0; } elseif ($daoClass == 'WellDAO') { $siteId = CoreServices2::getRequest()->getFromGet('site'); if (!empty($siteId)) { $siteDAO = new SiteDAO(); $this->pagePath = $siteDAO->getRecordPath($siteId); } $this->pagePath['wellName'] = 'New Well'; $this->pagePath['wellId'] = 0; } } }
protected function initCompany() { $companyDAO = new CompanyDAO(); $this->company = $companyDAO->getCompanyByUserId($this->currentUser['id']); }