/** * @param Idea $idea * @return Idea|null */ public function ideaRelatedTo(Idea $idea) { if ($this->idea1_id == $idea->id) { return Idea::find($this->idea2_id); } else { if ($this->idea2_id == $idea->id) { return Idea::find($this->idea1_id); } else { return null; } } }
public function idea($id = null) { $data['idea'] = Idea::find($id); $data['singleView'] = true; $this->render('ideas/single', $data); }
public function find(Route $route) { $this->mCategory = Idea::find($route->getParameter('mCategory')); }