Beispiel #1
0
 /**
  * Filter the query by a related \Models\BugReport object
  *
  * @param \Models\BugReport|ObjectCollection $bugReport the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildUserQuery The current query, for fluid interface
  */
 public function filterByBugReport($bugReport, $comparison = null)
 {
     if ($bugReport instanceof \Models\BugReport) {
         return $this->addUsingAlias(UserTableMap::COL_ID, $bugReport->getIdUser(), $comparison);
     } elseif ($bugReport instanceof ObjectCollection) {
         return $this->useBugReportQuery()->filterByPrimaryKeys($bugReport->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByBugReport() only accepts arguments of type \\Models\\BugReport or Collection');
     }
 }
Beispiel #2
0
 /**
  * @param ChildBugReport $bugReport The ChildBugReport object to add.
  */
 protected function doAddBugReport(ChildBugReport $bugReport)
 {
     $this->collBugReports[] = $bugReport;
     $bugReport->setUser($this);
 }
Beispiel #3
0
 public function reportBug()
 {
     if (!$this->isLogged()) {
         $this->addPopup('danger', 'Pro nahlášení chyby musíte být přihlášeni.');
         redirectTo("/");
     }
     if (!User::checkBugReportValidity()) {
         redirectTo("/nastaveni/nahlasit-chybu");
     }
     $bug = new BugReport();
     $bug->setIdUser($_SESSION["user"]->getId());
     $bug->setLocation(strip_tags($_POST["location"]));
     $bug->setDescription(strip_tags($_POST["description"]));
     $bug->setSeverity(strip_tags($_POST["severity"]));
     if (isset($_POST["device"])) {
         $bug->setDevice($_POST["device"]);
     }
     if (isset($_POST["browser"])) {
         $bug->setBrowser($_POST["browser"]);
     }
     $bug->save();
     $this->addPopup('success', 'Chyba byla úspěšně nahlášena. Děkujeme!');
     redirectTo("/nastaveni");
 }