function impression_create_form_submit($data) { $error = impression_validate($data); if (!empty($error)) { return FALSE; } $impression = new Impression(); $response = $impression->create($data); if ($response['id'] > 0) { return impression_list($response['id']); } else { return false; } }
public function registerAction() { try { if (!$this->request->getPost()) { throw new Exception('こらっ'); } $schedule = new Schedule(); $is_able_to_register = $schedule->is_in_time('regist', $this->current_time); if ($is_able_to_register) { // BMSデータを登録 $bms_info = new BmsInfo(); $bms_info->register($this->request->getPost(), $this->current_time, $this->ip, $this->host); // インプレッション用のDBを新規作成 $lastid = $bms_info->get_last_id(); $impression = new Impression($lastid); $impression->create(); header("Location: " . ROOT_URL . "/registration/thanks/"); } else { throw new Exception('作品登録期間ではありません'); } } catch (Exception $e) { $this->displayErrorView($e->getMessage()); } }