public function subscriptionsAction() { if (null === $this->_participant) { throw new Exception("We don't like trespassers, do you know that? Either knock the door or don't come at all..."); } parent::isParticipanActive(); $this->view->title = "Votes I'm Subscribed"; $_voteTable = new VoteTable(); $_votes = $_voteTable->findVotesSubscribedBy($this->_participant->id); $_answers = array(); $_selectedAnswers = array(); $_forms = array(); foreach ($_votes as $_v) { $_answers[$_v->id] = $_v->findAnswers(); $_selectedAnswers[$_v->id] = $_v->isVotedBy($this->_participant->id); if (null === $_selectedAnswers[$_v->id]) { $_f = new VoteForm(); $_f->setAnswers($_answers[$_v->id]); $_f->setVote($_v->id); $_forms[$_v->id] = clone $_f; } } $this->view->votes = $_votes; $this->view->answers = $_answers; $this->view->selectedAnswers = $_selectedAnswers; $this->view->forms = $_forms; }