protected function beforeRender() { parent::beforeRender(); $currentVersion = $this->addonVersions->getCurrent($this->addon->versions); if ($this->getUser()->isLoggedIn()) { $row = $this->addonVotes->findOneBy(array('userId' => $this->getUser()->getId(), 'addonId' => $this->addon->id)); $myVote = $row ? $row->vote : NULL; } else { $myVote = NULL; } $this['subMenu']->setAddon($this->addon); $this->template->addon = $this->addon; $this->template->version = $currentVersion; $this->template->composer = $currentVersion->composerJson; $this->template->myVote = $myVote; }