public function executeCreateTrial(sfWebRequest $request) { $this->authorizeUser(); $form = $request->getPostParameters(); if ($start_date = $form['newstartdatepicker']) { $institution = GcrInstitutionTable::getInstitution($form['eschool']); $trial = new GcrTrial(); $trial->setStartDate(strtotime($start_date)); $trial->setOrganizationId($institution->getId()); $trial->save(); } $this->redirect(GcrEschoolTable::getHome()->getUrl() . '/homeadmin/trials'); }
public function createNewTrial($start_date = null) { if (!$start_date) { $start_date = time(); } $trialObject = new GcrTrial(); $trialObject->setOrganizationId($this->id); $trialObject->setStartDate($start_date); // try to add this trial record to the trial table $trialObject->save(); }