Updates the given feature.

@param  FeaturesRequest $request
@param  Feature $feature

@return void
168628
public function update(FeaturesRequest $request, Feature $feature)
    {
        if ($request->has('name') && $feature->name != $request->get('name')) {
            event(new FeatureNameWasUpdated($feature, $request->get('name')));
        }

        $feature->update(
            $request->except('name')
        );

        return redirect()->route('features.edit', $feature)->with('status', trans('globals.success_text'));
    }
1075414
public function delete(FeatureAvDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== ($feature = FeatureAvQuery::create()->findPk($event->getFeatureAvId()))) {
            $feature
                ->setDispatcher($dispatcher)
                ->delete()
            ;

            $event->setFeatureAv($feature);
        }
    }
1198951
public function update(Request $request)
    {
        $key = $request->get('key');
        $type = $request->get('type');

        /** @var DataType $class */
        $class = $this->{$type}();

        $class->update($request->all());

        $class->setTtl($key, $request->get('ttl'));
    }
409661
public function write($path, FeatureNode $feature)
    {
        file_put_contents($this->getCachePathFor($path), serialize($feature));
    }
999135
public function update(Request $request, $id)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $request->validate([
            "name" => "required|max:36",
            "description" => "required|max:128",
        ]);
        $memberCategory = MemberCategory::findOrFail($id);
        $this->authorize('update', $memberCategory);
        $memberCategory->name = $request->name;
        $memberCategory->description = $request->description;
        $memberCategory->update();
        return fractal($memberCategory, new MemberCategoryTransformer())
            ->withResourceName('memberCategory')
            ->respond();
    }
1011600
public function setVariable($key, $value, $feature = null)
    {
        $this->variables[$key] = $value;

        $this->set($key, $value, $feature);

        return $this;
    }
387277
public function mergeFeatures(array $features)
    {
        /** @var FeatureInterface $feature */
        foreach ($features as $feature) {
            $this->storeToAll($feature);
            $this->storeToCanonical($feature);
        }
    }
69520
public function vote(FeatureInterface $feature, Context $context)
    {
        if (!$feature->isEnabled()) {
            return false;
        }

        $context->setName($feature->getName());

        $breaker = $feature->getBreaker();
        if ($breaker->hasFilter() && $this->voter->vote($breaker->getFilterGroups(), $context)) {
            return false;
        }

        $filter = $feature->getFilter();

        return $filter->hasFilter() ? $this->voter->vote($filter->getFilterGroups(), $context) : true;
    }
947316
public function activateRole($featureName, $roleName)
    {
        $feature = $this->getFeature($featureName);
        $feature->addRole($roleName);
        $this->saveFeature($feature);
    }
202873
public function updateAction(Request $request)
        {

            try {
                $id = $this->getUser()->getId();

                /** @var User $oUser */
                $oUser = UserQuery::create()->findOneById($id);

                if ($oUser === null) {
                    throw $this->createNotFoundException('Unable to find User entity.');
                }

                $aPost = $request->request->get("form");


                $nbUpdatedRows = UserQuery::create()
                    ->filterById($id)
                    ->update(array('NotificationError' => isset($aPost['notification_error']), 'NotificationChange' => isset($aPost['notification_change'])));


                $aResult = array(
                    "success" => true,
                    "message" => $this->get("translator")->trans("notificationcenter.save.successful")
                );

            } catch (\Exception $e) {
                $aResult = array(
                    "success" => false,
                    "message" => $this->get("translator")->trans("notificationcenter.save.failed") . ":<br>" . $e->getMessage()
                );
            }

            $sResult  = json_encode($aResult);
            $response = new Response($sResult);
            $response->headers->set('Content-Type', 'application/json');

            return $response;

        }
926802
def update(self, request, id):
        
        if self.readonly:
            return HTTPMethodNotAllowed(headers={'Allow': 'GET, HEAD'})
        session = self.Session()
        obj = session.query(self.mapped_class).get(id)
        if obj is None:
            return HTTPNotFound()
        feature = loads(request.body, object_hook=GeoJSON.to_instance)
        if not isinstance(feature, Feature):
            return HTTPBadRequest()
        if self.before_update is not None:
            self.before_update(request, feature, obj)
        obj.__update__(feature)
        session.flush()
        request.response.status_int = 200
        return obj
227497
function(model) {
        model.can = _.extend({create: true, read: true, update: true, delete: true}, model.can, feature.can);
    }
456433
public function update(UpdateRequest $request)
    {
        $requestEntity = $this->repository->find($request->id);

        // TODO What's happening in here?
        if (!$requestEntity instanceof RequestEntity) {
            return response(404);
        }

        $requestEntity->update($request->all());
        $this->repository->flush();

        return response(['data' => $requestEntity->toArray()], 200);
    }
1071971
public function execute($request): void
    {
        RequestNotSupportedException::assertSupports($this, $request);

        $request->setResult([
            Constants::FIELD_PAID => false,
        ]);
    }
84667
public function editAction($featureId, $id)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var Feature $feature */
        $feature = $em->getRepository('EcommerceBundle:Feature')->find($featureId);

        if (!$feature) {
            throw $this->createNotFoundException('Unable to find Feature entity.');
        }

        /** @var FeatureValue $entity */
        $entity = $em->getRepository('EcommerceBundle:FeatureValue')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find FeatureValue entity.');
        }

        $editForm = $this->createForm(new FeatureValueType(), $entity);
        $deleteForm = $this->createDeleteForm($featureId, $id);

        return array(
            'entity'      => $entity,
            'feature'   => $feature,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
1331165
public function update(Request $request)
    {
        $role = Role::findOrFail($request->role_id);

        $role->name = $request->name;

        $role->update();

        return redirect('scaffold-roles');
    }
792142
public function updateOne(int $featureId, $value, string $type) : array {
        return $this->sendPatch(
            sprintf('/profiles/%s/features/%s', $this->userName, $featureId),
            [],
            [
                'value' => $value,
                'type'  => $type
            ]
        );
    }