Edit customfield

@param  int  $id
@return mixed
480358
public function edit($id, Route $route)
    {
        return $this->processor->edit($this, $id, $route);
    }
339360
public function edit($id)
    {
        // Fetch the user object
        // $id = $this->decode($hash);
        $user = $this->userRepository->findById($id);

        // Fetch the available roles
        $roles = app()->make('sentinel.roles')->createModel()->all();

        if ($user) {
            return view('Centaur::users.edit', [
                'user' => $user,
                'roles' => $roles
            ]);
        }

        session()->flash('error', 'Invalid user.');
        return redirect()->back();
    }
736334
public function edit($id): Content
    {
        return Admin::content(function (Content $content) use ($id) {
            $content->header($this->title());

            $content->body($this->form($id)->edit($id));
        });
    }
478422
public function edit($id)
    {
        // Is this user allowed to do this?
        if (!$this->repository->isUserAllowed('edit'))
        {
            Session::flash('status_code', 400 );
            $message = "You are not allowed to edit ".$this->table_type_plural;
            Session::flash('message', $message);
            return view('formhandling::warnings/' . config('lasallecmsadmin.admin_template_name') . '/user_not_allowed', [
                'package_title'        => $this->package_title,
                'table_type_plural'    => $this->table_type_plural,
                'table_type_singular'  => $this->table_type_singular,
                'resource_route_name'  => $this->resource_route_name,
                'HTMLHelper'           => HTMLHelper::class,
            ]);
        }

        // Is this record locked?
        if ($this->repository->isLocked($id))
        {
            $message = 'This tag is not available for editing, as someone else is currently editing this tag';
            Session::flash('message', $message);
            Session::flash('status_code', 400 );
            return Redirect::route('admin.'.$this->resource_route_name.'.index');
        }

        // Lock the record
        $this->repository->populateLockFields($id);

        return view('formhandling::lookuptables/' . config('lasallecmsadmin.admin_template_name') . '/create', [
            'package_title'       => $this->package_title,
            'table_type_plural'   => $this->table_type_plural,
            'table_type_singular' => $this->table_type_singular,
            'resource_route_name' => $this->resource_route_name,
            'DatesHelper'         => DatesHelper::class,
            'HTMLHelper'          => HTMLHelper::class,
            'record'              => $this->repository->getFind($id),
        ]);
    }
439231
public function edit(int $id)
    {
        try {
            $address = Auth::user()->findAddress($id);
        } catch(\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
            return $this->respondsWithError(trans('address.errors.model_not_found'));
        }

        return view('address.form_edit', compact('address'));
    }
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');
		}
	}
364585
public function edit($id)
    {
        $content = $this->content->findById($id);

        if (! $content) {
            return $this->handleError(trans('soda::errors.not-found', ['object' => trans('soda::terminology.content')]));
        }

        $content->load('blockTypes.fields', 'type.blockTypes.fields', 'type.fields');
        $blockTypes = $this->content->getAvailableBlockTypes($content);

        $this->buildBreadcrumbTree($content);
        app('soda.interface')->setHeading($content->name);

        return view($content->edit_action, compact('content', 'blockTypes'));
    }
69398
public function edit($id)
    {
        $model = $this->repository->find($id);
        return view('avored-framework::system.site-currency.edit')
                    ->with('model', $model);
    }
1290404
public function edit($id = null) {
		$country = $this->Countries->get($id);

		if ($this->Common->isPosted()) {
			$country = $this->Countries->patchEntity($country, $this->request->getData());
			if ($this->Countries->save($country)) {
				$name = $country['name'];
				$this->Flash->success(__('record edit {0} saved', h($name)));
				return $this->redirect(['action' => 'index']);
			}

			$this->Flash->error(__('record edit not saved'));
		}

		$this->set(compact('country'));
	}
550857
public function edit($id)
    {
        if (!$role = $this->roleRepositoryInterface->getById($id)) {
            Flash::error(trans('dashboard::dashboard.errors.role.found'));

            return redirect()->route('roles.index');
        }

        $permissions = $this->permissionRepositoryInterface->getAll();

        return $this->view('roles.edit')->with(['role' => $role, 'permissions' => $permissions]);
    }
331236
public function editAction( $id = null ) {
		$request = $this->getRequest();

		$pageId      = $request->get( 'pageId' );
		$formFieldId = $request->get( 'formFieldId' );
		$uniqId      = $request->get( 'uniqId' );
		$code        = $request->get( 'code', 'networking_init_cms.admin.page' );


		$layoutBlock = $this->admin->getObject( $id );

		/** @var $form \Symfony\Component\Form\Form */
		$form = $this->admin->getForm();
		$form->setData( $layoutBlock );

		$form->handleRequest( $request );
		$response = null;

		if ( $form->isSubmitted() ) {
			if ( $form->isValid() ) {
				$this->admin->update( $layoutBlock );
				$html   = $this->getLayoutBlockFormWidget( $pageId, $formFieldId, $uniqId, $code );
				$status = 200;

				return new Response( $html, $status );
			} else {
				$this->error = true;

				$response = new Response();
				$response->setStatusCode( 500 );
			}

		}

		$view = $form->createView();

		// set the theme for the current Admin Form
		$this->get( 'twig' )->getRuntime( FormRenderer::class )->setTheme( $view, $this->admin->getFormTheme() );

		return $this->renderWithExtraParams(
			'@NetworkingInitCms/PageAdmin/layout_block_edit.html.twig',
			[
				'action' => 'create',
				'form'   => $view,
				'object' => $layoutBlock,
			],
			$response
		);
	}
103979
public function removeFieldById($id)
    {
        foreach ($this->fields as $i => $field) {
            if ($field->getId() == $id) {
                unset($this->fields[$i]);
                break;
            }
        }

        return $this;
    }
1073166
public function edit($id)
    {
        $role = Role::findOrFail($id);
        $permissions = Permission::select('id', 'name', 'label')->get()->pluck('label', 'name');

        return view('admin.roles.edit', compact('role', 'permissions'));
    }
943221
public function edit(string $id)
    {
        $savedWidgetData = [];
        $dashboard = $this->Dashboards->get($id, [
            'contain' => ['Widgets']
        ]);

        $dashboardWidgets = $dashboard->get('widgets');
        $dashboard->unsetProperty('widgets');

        /**
         * @var \Search\Model\Table\WidgetsTable $widgetsTable
         */
        $widgetsTable = TableRegistry::get('Search.Widgets');
        $widgets = $widgetsTable->getWidgets();

        $sequence = 0;

        foreach ($dashboardWidgets as $dw) {
            foreach ($widgets as $widget) {
                if ($dw->widget_id !== $widget['data']['id']) {
                    continue;
                }

                $widgetOptions = $widgetsTable->getWidgetOptions($dw, ['sequence' => $sequence]);

                $item = array_merge(
                    [
                        'id' => $widget['data']['id']
                    ],
                    [
                        'data' => $widget['data']
                    ],
                    $widgetOptions
                );
                unset($item['data']['content'], $item['data']['created'], $item['data']['modified']);
                if (!empty($item['data']['query'])) {
                    unset($item['data']['query']);
                }
                array_push($savedWidgetData, $item);

                $sequence++;
            }
        }

        if ($this->request->is(['patch', 'post', 'put'])) {
            $data = (array)$this->request->getData();

            $dashboard->unsetProperty('widgets');

            $dashboard = $this->Dashboards->patchEntity($dashboard, [
                'name' => $data['name'],
                'role_id' => $data['role_id']
            ]);

            if ($this->Dashboards->save($dashboard)) {
                $this->Flash->success((string)__('The dashboard has been saved.'));
                /** @var \Search\Model\Table\WidgetsTable */
                $widgetTable = TableRegistry::get('Search.Widgets');
                $widgetTable->trashAll([
                    'dashboard_id' => $dashboard->id
                ]);

                $data['widgets'] = !empty($data['options']) ? json_decode($data['options'], true) : [];
                if (!empty($data['widgets'])) {
                    $widgetsTable->saveDashboardWidgets($id, $data['widgets']);
                }

                return $this->redirect(['action' => 'view', $id]);
            } else {
                $this->Flash->error((string)__('The dashboard could not be saved. Please, try again.'));
            }
        }

        $roles = $this->Dashboards->Roles->find('list', ['limit' => 200]);

        $this->set(compact('dashboard', 'roles', 'widgets', 'savedWidgetData'));
        $this->set('columns', Configure::readOrFail('Search.dashboard.columns'));
        $this->set('_serialize', ['dashboard']);
    }
372333
public function edit($id)
    {
        $role = $this->roles->findById($id);
        $permissionIds = $this->roles->getPermissions();

        if (! $role) {
            return $this->handleError(trans('soda::errors.not-found', ['object' => 'role']));
        }

        app('soda.interface')->setHeading($role->display_name);
        app('soda.interface')->breadcrumbs()->addLink(route('soda.roles.index'), 'Roles');

        return soda_cms_view('data.roles.view', compact('role', 'permissionIds'));
    }
1122753
public function createEditForm($id) {
        $entity = $this->read_handler->get($id);
        $edit_form = $this->form_factory->create(new Type(), $entity);

        return $edit_form;
    }
99079
public function edit($id): Response
    {
        if ($objectInfo = $this->model->findFirst($id)) {
            $request = $this->request->getPut();

            if (empty($request)) {
                $request = $this->request->getJsonRawBody(true);
            }

            if (empty($request)) {
                throw new Exception('No valid data sent.');
            }

            //set the custom fields to update
            $objectInfo->setCustomFields($request);

            //update
            if ($objectInfo->update($request, $this->updateFields)) {
                return $this->getById($id);
            } else {
                //didnt work
                throw new Exception($objectInfo->getMessages()[0]);
            }
        } else {
            throw new Exception(_('Record not found'));
        }
    }