Updates the response content

@param Response $response
@param array    $data
@return JsonResponse|Response
5513
protected function setResponseData(Response $response, array $data)
    {
        if ($response instanceof JsonResponse) {
            /** @var $response JsonResponse */
            return $response->setData($data);
        }

        $content = json_encode($data, JsonResponse::DEFAULT_ENCODING_OPTIONS);

        return $response->setContent($content);
    }
1179292
protected function modifyResponse(array $response = array())
    {
        if (!empty($response['html']))
        {
            $replace = array('<![CDATA[' => '', ']]>' => '', '\'' => '"');
            $response['html'] = str_ireplace(array_keys($replace), array_values($replace), $response['html']);
        }

        return $response;
    }
279450
public function respondWithData(array $data)
    {

        $responseData = $this->getResponseStructure(true, $data, '');
        $response = new JsonResponse($responseData, $this->getStatusCode(), $this->getHeaders());
        return $response;
    }
849992
public function update($collectionName, $id, array $data)
    {
        $payload = ["data" => $data];
        $response = $this->doRequest('PUT', 'collections/' . $collectionName . '/' . $id . '/', $payload);
        $body = $response->getBody()->getContents();
        return json_decode($body, true);
    }
279718
public function update($service, $headers = null, $data)
	{
		return $this->put($service, $headers, $data);
	}
1037536
public function update(array $data): \PDOStatement
    {
        /**
         * @var $response \PDOStatement
         */
        $queryObject = $this->getQuery('update', $data);

        $this->connection->setLastQuery($queryObject);

        $this->fireEvents(EventHandler::EVENT_BEFORE_UPDATE, $queryObject);

        [$response, $executionTime] = $this->statement($queryObject->getSql(), $queryObject->getBindings());

        $this->fireEvents(EventHandler::EVENT_AFTER_UPDATE, $queryObject, [
            'execution_time' => $executionTime,
        ]);

        return $response;
    }
1064283
public function update($id, $data)
	{
		$this->getResponse()
			->setStatusCode(Response::STATUS_CODE_201);
		
		//$data = $this->getModel()->;
		
		return new JsonModel(array(
			'data' => "Update object resource " . $id // chiamata a this->get
		));
	}
1111352
protected function respond($data, $headers = [])
    {
        $this->setResponseHeaders($headers);

        return response()->json($data, $this->getStatusCode(), $this->getResponseHeaders());
    }
699150
public function render(ResponseInterface $response, $template, array $data = array())
    {
        $this->view->loadFile($this->templatesPath . DIRECTORY_SEPARATOR . $template);
        $this->renderWithData($response, $data);
        return $response;
    }
522022
public function update($id, $data)
    {
        $message = $this->client->put(
            sprintf('buckets/%d/messages/%d.json', $this->bucket, $id),
            [
                'json' => $data,
            ]
        );

        return new Message($this->response($message));
    }
63367
public function update($id, $data)
    {
        $response = $this->handler->handle('PUT', $data);

        return $this->make($response, false);
    }
319553
public function update($object, array $data)
	{
		$updated = $object->update($data);

		if( ! $updated)
		{
			return new Payload($object , 'not_updated');
		}

		// Replace the existing cached model with the updated model.
		Cache::tags($this->model->getTable())->forever($updated->getKey(), $updated);

		return new Payload($object, 'updated');
	}
1209896
protected function modifyResponse(array $response = array())
    {
        if (!empty($response['html'])) {
            $spam = array('~<p>(?:.*)</p>~i', '~<div (?:.*)</div>~i');
            $response['html'] = preg_replace($spam, '', $response['html']);
        }

        return $response;
    }
1203815
protected function _modifyAfterUpdate($response, $request) {
        if ($this->_methodFailed($response)) {
            return $response;
        }
        $methodParts = explode('.', $request['method']);
        $modelClass  = Garp_Content_Api::modelAliasToClass(array_shift($methodParts));
        $man = new Garp_Content_Manager($modelClass);
        $rows = $man->fetch(
            array(
                'query' => array('id' => $request['params'][0]['rows']['id'])
            )
        );
        $response['result'] = array(
            'rows' => $rows
        );
        return $response;
    }
64301
public function update($id, $data)
    {
        $routeMatch = $this->getEvent()->getRouteMatch();
        $mode = $routeMatch->getParam('mode', false);
        $type = $routeMatch->getParam('type', false);
        $endpoint = $routeMatch->getParam('endpoint', false);
        $annee = $routeMatch->getParam('annee', 0);
        
        $processStateHandler = $this->getProcessStateHandler();
        $process = $processStateHandler->getProcess($mode, $type, $endpoint, $annee);
        
        if (is_null($process)) {
            $process = $processStateHandler->getDefaultProcess($mode, $type, $endpoint, $annee);
            $processStateHandler->saveProcess($process);
        }
        if (array_key_exists('force-execution-stop', $data)) {
            $process->setInterrupted(true);
        } else {
            $active = array_key_exists('active', $data) && $data['active'] === 'true';
            $process->setActive($active);
            $shedule = $data['shedule'] === 'true' && $data['active'] === 'true';
            $process->setShedule($shedule);
            $process->setCron($shedule ? $data['cron'] : null);
        }
        
        $processStateHandler->saveProcess($process);
        $response = $this->getResponse();
        $response->getHeaders()->addHeaderLine('Content-Type', 'application/json');
        $serializer = $this->getSerializer();
        $processJson = $serializer->serialize($process, 'json');
        $response->setContent($processJson);
        return $response;
    }
338397
public function update($id, array $data)
    {
        $todolist = $this->client->put(
            sprintf('buckets/%d/todolists/%d.json', $this->bucket, $id),
            [
                'json' => $data,
            ]
        );

        return new TodoList($this->response($todolist));
    }
152527
public function updateAction(ServerRequest $request, Response $response)
    {
        $script         = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extParams']['tw_componentlibrary']['script'];
        $descriptorspec = array(
            0 => array('pipe', 'r'),
            1 => array('pipe', 'w'),
            2 => array('pipe', 'a')
        );

        $process = proc_open($script, $descriptorspec, $pipes);
        stream_get_contents($pipes[1]);
        fclose($pipes[1]);
        $status = proc_get_status($process);

        // If an error occured
        if ($status['exitcode']) {
            return $response->withStatus(500);
        }

        return $response;
    }