function post() { $sound_id = $this->app->request->post('sound_id'); if ($this->tap != self::ONE_TAP && $this->tap != self::TWO_TAP && $this->tap != self::LONG_TAP) { //タップの種類が想定以外のものの場合は400を返す $this->app->response->setStatus(400); return; } if (empty($sound_id)) { $this->app->response->setStatus(400); } $model = new BeaconModel(); $model->updateBeacon($this->id, $this->tap . "_sound", $sound_id); echo '{"status": 0}'; }