Responds to the OPTIONS request.
@param string $id
553330
public function run($id = null)
    {
        $app = $this->getApp();
        if ($app->getRequest()->getMethod() !== 'OPTIONS') {
            $app->getResponse()->setStatusCode(405);
        }
        $options = $id === null ? $this->collectionOptions : $this->resourceOptions;
        $app->getResponse()->getHeaderCollection()->set('Allow', implode(', ', $options));
        $app->getResponse()->getHeaderCollection()->set('Access-Control-Allow-Method', implode(', ', $options));
    }
498005
public static function cancel($id, $options = null)
    {
        $url = static::classUrl().'/'.$id;
        $params = array('status' => 'canceled');
        return static::_directRequest('put', $url, $params, $options);
    }
1349266
public function deactivate(string $id): Response
    {
        return $this->proxyRequestViaVersion('v3', function () use ($id) {
            return parent::deactivate($id);
        });
    }
103936
public function show(int $id = 0): ShowResponseContract
    {
        $item = $this->services['widgets']->getWidgetObject($id);

        return app()->makeWith('InetStudio\Widgets\Contracts\Http\Responses\Back\Widgets\ShowResponseContract', [
            'item' => $item,
        ]);
    }
69504
public function openEditorAction($id)
    {
        $media = $this->getMedia($id);

        if (!$this->isEditable($media)) {
            throw new NotFoundHttpException('The media is not editable');
        }

        return new Response($this->templating->render('@SonataMedia/Extra/pixlr_editor.html.twig', [
            'media' => $media,
            'admin_pool' => $this->container->get('sonata.admin.pool'),
        ]));
    }
282015
public function edit($id)
    {
        if (!$this->request->is(['get', 'put'])) {
            throw new MethodNotAllowedException();
        }

        $group = $this->Groups->get($id);

        if ($this->request->is('put')) {
            $group = $this->Groups->patchEntity($group, $this->request->data);
            if ($this->Groups->save($group)) {
                $this->Flash->success(__d('wasabi_core', 'The group <strong>{0}</strong> has been saved.', $this->request->data['name']));
                $this->redirect($this->Filter->getBacklink(['action' => 'index'], $this->request));
                return;
            } else {
                $this->Flash->error($this->formErrorMessage);
            }
        }
        $this->set('group', $group);
        $this->render('add');
    }
1354329
public function edit($id)
    {
        $filters = [];
//        // handle permission
//        $filters = $this->handlePermission(__FUNCTION__);

        // Create Response Model
        $response = new ResponseModel();

        try {
            $response->setMessage($this->getTrans('edit', 'successful'));

            // add filter to get desired record
            array_push($filters,
                [$this->model->getKeyName(), '=', $id]
            );
            $data = $this->model
                ->where($filters)
                ->with(collect($this->editLoad)->count() == 0 ? $this->indexLoad : $this->editLoad)
                ->get();
            $response->setData($data);

        } catch (ModelNotFoundException $exception) {
            $response->setError($exception->getCode());
            $response->setMessage($this->getTrans('edit', 'failed'));
            $response->setStatus(false);
            if (env('APP_DEBUG', false)) {
                $response->setData(collect($exception->getMessage()));
            }

        }

        return SmartResponse::response($response);
    }
137726
public static function retrieve($id, $options = null)
    {
        $url = static::classUrl().'/'.$id;
        return static::_directRequest('get', $url, null, $options);
    }
172011
public function show($id)
    {
        // get permission by id
        $permission = Permission::find($id);

        if (!$permission) {
            return response()->json(null, 404);
        }

        return response()->json(arrayView('phpsoft.users::permission/read', [
            'permission' => $permission
        ]), 200);
    }
1296140
public function get($id)
    {
        $request = new Request('customizations');
        $request->setIdParam(urlencode($id));

        $response = $this->client->get($request);

        $this->assertSuccessResponse($response);

        return $response->getData();
    }
1229497
public function actionEdit(int $id): void
	{
		$this->content = $this->orm->content->getById($id);
		if (!$this->content) {
			$this->error();
		}
	}
88408
public function _restPutResource($id) {
    $this->model->loadFromExternalSource($this->getApp()->getRequest()->getBody());
    $this->model->setId($id);

    $this->model->save();
    echo $this->model->outputJSON();
  }
1342161
public function viewAction($id)
    {
        /** @var BlockManager $manager */
        $manager = $this->get('opifer.content.block_manager');

        /** @var BlockInterface $block */
        $block = $manager->getRepository()->find($id);

        if (!$block) {
            throw $this->createNotFoundException();
        }

        $response = new Response();

        /** @var Environment $environment */
        $environment = $this->get('opifer.content.block_environment');
        $environment->setObject($block->getOwner());

        $service = $manager->getService($block);

        $response = $service->execute($block, $response, [
            'partial' => true,
            'environment' => $environment
        ]);

        return $response;
    }
212931
public function actionClick($id) 
	{
		$model=$this->loadModel($id);
		if($id == null || $model == null)
			$this->redirect(Yii::app()->createUrl('site/index'));
		else {
			BannerClicks::insertClick($model->banner_id);
			$this->redirect($model->url);
		}
	}
182589
public function set_id( $id ) {
		$this->id = $this->is_valid_id( $id ) ? $id : $this->generate_session_id();
	}
1339082
protected function _edit($id) {
		try {
			$result = $this->{$this->modelClass}->edit($id, $this->request->data);
		} catch (OutOfBoundsException $e) {
			return $this->alert($e, array('redirect' => $this->referer(array('action' => 'list'), true)));
		}

		$this->request->data = $this->{$this->modelClass}->data;

		if (!empty($this->request->data[$this->{$this->modelClass}->alias][$this->{$this->modelClass}->displayField])) {
			$this->_appendToCrumb($this->request->data[$this->{$this->modelClass}->alias][$this->{$this->modelClass}->displayField]);
		}

		if (false === $result) {
			$this->alert('save.fail');
		} else if ($this->request->is('put')) {
			$this->alert('save.success');
		}
	}
946563
public function edit($id)
    {
        try{
            $user = Sentry::findUserById($id);
            //display edit form in non-ajax request
            //
            $this->data['title'] = 'Edit User';
            $this->data['user'] = $user->toArray();

            View::display('@usergroup/user/edit.twig', $this->data);
        }catch(UserNotFoundException $e){
            App::notFound();
        }catch(Exception $e){
            Response::setBody($e->getMessage());
            Response::finalize();
        }
    }