public function create(string $confId) { if (!empty($confId)) { $conference = ConferenceModel::getConferenceById((int) $confId)[0]; $data = array("confId" => $confId, "confName" => $conference['conference_title']); $this->view->render('lecture/create', $data); } }
public function edit_action(string $confId) { $success = ConferenceModel::updateConference((int) $confId); if ($success) { Redirect::to('conference/index'); } else { Redirect::to('conference/edit/' . $confId); } }
private static function validateConference($confTitle, $venueName) { if (empty($confTitle) || empty($venueName)) { Session::push('feedback_negative', Text::get('CONFERENCE_FIELD_EMPTY')); return false; } // no conference by this title should exist if (ConferenceModel::getConferenceByTitle($confTitle)) { Session::push('feedback_negative', Text::get('CONFERENCE_ALREADY_EXISTS')); return false; } if (!VenueModel::venueExists($venueName)) { if (!VenueModel::createVenueInDb($venueName)) { Session::push('feedback_negative', Text::get('UNKNOWN_ERROR')); return false; } } return true; }