/** * Retrieves the project data from the database * * @return void * * @since 1.0 */ protected function getProjectData() { // Get the ID for the project on our tracker $query = $this->db->getQuery(true); $query->select('*'); $query->from($this->db->quoteName('#__tracker_projects')); $query->where($this->db->quoteName('gh_project') . ' = ' . $this->db->quote($this->hookData->repository->name)); $this->db->setQuery($query); try { $this->project = $this->db->loadObject(); } catch (\RuntimeException $e) { $this->logger->info(sprintf('Error retrieving the project ID for GitHub repo %s in the database: %s', $this->hookData->repository->name, $e->getMessage())); $this->getContainer()->get('app')->close(); } // Make sure we have a valid project ID if (!$this->project->project_id) { $this->logger->info(sprintf('A project does not exist for the %s GitHub repo in the database, cannot add data for it.', $this->hookData->repository->name)); $this->getContainer()->get('app')->close(); } }