protected function _populateRecentIssues($issuetype) { $issuetype_id = is_object($issuetype) ? $issuetype->getID() : $issuetype; if (!array_key_exists($issuetype_id, $this->_recentissues)) { $this->_recentissues[$issuetype_id] = array(); if ($res = tables\Issues::getTable()->getRecentByProjectIDandIssueType($this->getID(), $issuetype_id)) { while ($row = $res->getNextRow()) { try { $issue = new \thebuggenie\core\entities\Issue($row->get(tables\Issues::ID), $row); if ($issue->hasAccess()) { $this->_recentissues[$issuetype_id][$issue->getID()] = $issue; } } catch (\Exception $e) { } } } } }
public function hasAccess() { $issue_ids = tables\IssueFiles::getTable()->getIssuesByFileID($this->getID()); foreach ($issue_ids as $issue_id) { $issue = new \thebuggenie\core\entities\Issue($issue_id); if ($issue->hasAccess()) { return true; } } $event = \thebuggenie\core\framework\Event::createNew('core', 'thebuggenie\\core\\entities\\File::hasAccess', $this); $event->setReturnValue(false); $event->triggerUntilProcessed(); return $event->getReturnValue(); }