/** * Returns the number of related Idea objects. * * @param Criteria $criteria * @param boolean $distinct * @param ConnectionInterface $con * @return int Count of related Idea objects. * @throws PropelException */ public function countIdeasRelatedByApprovedBy(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collIdeasRelatedByApprovedByPartial && !$this->isNew(); if (null === $this->collIdeasRelatedByApprovedBy || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collIdeasRelatedByApprovedBy) { return 0; } if ($partial && !$criteria) { return count($this->getIdeasRelatedByApprovedBy()); } $query = ChildIdeaQuery::create(null, $criteria); if ($distinct) { $query->distinct(); } return $query->filterByUserApproved($this)->count($con); } return count($this->collIdeasRelatedByApprovedBy); }
public function singleIdeaSuggestionPage($id) { $idea = IdeaQuery::create()->joinUserAuthor('UserAuthor')->with('UserAuthor', 'UserAuthor')->joinUserApproved('UserApproved')->with('UserApproved', 'UserApproved')->findPk($id); if ($idea == NULL) { $this->addPopup('danger', 'Návrh na zlepšení s tímto identifikačním číslem se v databázi nenachází.'); redirectTo("/administrace"); } $this->view('Admin/singleIdeaPage', 'admin_template', ['active' => 'singleIdeaPage', 'title' => 'Návrh na zlepšení', 'idea' => $idea]); }