Edits the current response.
@param string  $id       The ID of the channel the response is in ("DM" for direct messages).
@param string  $type
@param string  $content
@param array   $options
@return \React\Promise\ExtendedPromiseInterface
965244
protected function editCurrentResponse(string $id, string $type, string $content, array $options = array()) {
        if(empty($this->responses[$id])) {
            $this->responses[$id] = array();
        }
        
        if(!empty($this->responses[$id])) {
            $msg = \array_shift($this->responses[$id]);
        } else {
            $msg = null;
        }
        
        return $this->editResponse($msg, $type, $content, $options);
    }
885359
public function remove($id_option, string $type = 'page'): ?int
  {
    if ( $id_option = $this->_get_id_option($id_option, $type) ){
      return $this->pref->delete($id_option);
    }
    return null;
  }
52275
private function updateClassContent($type, $uid, $data)
    {
        $this->granted('EDIT', $content = $this->getClassContentByTypeAndUid($type, $uid, true, true));
        $this->getClassContentManager()->update($content, $data);

        return $content;
    }
189448
public function delete($id, $type) {
		$params = array(
			'id' => $id,
			'type' => $type
		);
		return $this->master->call('files/delete', $params);
	}
253236
public function problem($id, $type = 'id')
    {
        $problem = $this->load('p', array($type, $id));

        return Helper\formatProblem($problem);
    }
601843
public function alert(String $type, $content)
    {
        $content = $this->stringOrCallback($content);

        $this->isBootstrapAttribute('dismiss-fade', function() use(&$type)
        {
            $type .= ' alert-dismissible fade show';
        });

        $this->isBootstrapAttribute('dismiss-button', function($attribute) use(&$content)
        {
            $content .= $this->buttonDismissButton($this->spanDismissButton($attribute));  
        });

        return $this->role('alert')->class('alert alert-' . $type)->div($content);
    }
1023613
public function updateUser($id, array $content, array $options = [])
    {
        $data = [
            '_id' => $id,
            'body' => $content
        ];

        $response = $this->kuzzle->query(
            $this->buildQueryArgs('updateUser'),
            $data,
            $options
        );

        return new User($this, $id, $response['result']['_source'], $response['result']['_meta']);
    }
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));
        });
    }
149912
public function update($index, $type, $id, $data, $options = [])
    {
        $body = [
            'doc' => empty($data) ? new \stdClass() : $data,
        ];
        if (isset($options["detect_noop"])) {
            $body["detect_noop"] = $options["detect_noop"];
            unset($options["detect_noop"]);
        }

        return $this->db->post([$index, $type, $id, '_update'], $options, Json::encode($body));
    }
821021
public function updateSelf(array $content, array $options = [])
    {
        $response = $this->query(
            $this->buildQueryArgs('auth', 'updateSelf'),
            [
                'body' => $content
            ],
            $options
        );

        return $response['result'];
    }
720081
public function creatorAction($type, $id = null, $content = null, $father = null)
    {
        //cant use @Secure(roles="ROLE_ADMIN") annotation beacause this method is called in anonymous mode
        if ($this->canEdit()) {
            return $this->render(
                'ClarolineCoreBundle:home/types:'.$type.'.creator.twig',
                $this->manager->getCreator($type, $id, $content, $father),
                true
            );
        }

        return new Response(); //return void and not an exeption
    }
354686
protected function compress($content, $type, $options = array())
    {
        $commandline =array($this->javaPath);

        if (null !== $this->stackSize) {
            array_push($commandline, '-Xss'.$this->stackSize);
        }

        array_push($commandline, '-jar', $this->jarPath);

        foreach ($options as $option) {
            array_push($commandline, $option);
        }

        if (null !== $this->charset) {
            array_push($commandline, '--charset', $this->charset);
        }

        if (null !== $this->lineBreak) {
            array_push($commandline, '--line-break', $this->lineBreak);
        }

        // input and output files
        $tempDir = FilesystemUtils::getTemporaryDirectory();
        $input = tempnam($tempDir, 'assetic_yui_input');
        $output = tempnam($tempDir, 'assetic_yui_output');
        file_put_contents($input, $content);
        array_push($commandline, '-o', $output, '--type', $type, $input);

        $proc = new Process(implode(' ', $commandline));
        $code = $proc->run();
        unlink($input);

        if (0 !== $code) {
            if (file_exists($output)) {
                unlink($output);
            }

            throw FilterException::fromProcess($proc)->setInput($content);
        }

        if (!file_exists($output)) {
            throw new \RuntimeException('Error creating output file.');
        }

        $retval = file_get_contents($output);
        unlink($output);

        return $retval;
    }
651448
public function response($content, $type = self::MSG_TYPE_TEXT){
        /* 基础数据 */
        $data = array(
            'ToUserName'   => $this->data['FromUserName'],
            'FromUserName' => $this->data['ToUserName'],
            'CreateTime'   => NOW_TIME,
            'MsgType'      => $type,
        );

        /* 按类型添加额外数据 */
        $content = call_user_func(array(self, $type), $content);
        if($type == self::MSG_TYPE_TEXT || $type == self::MSG_TYPE_NEWS){
            $data = array_merge($data, $content);
        } else {
            $data[ucfirst($type)] = $content;
        }

        /* 转换数据为XML */
        $xml = new \SimpleXMLElement('<xml></xml>');
        self::data2xml($xml, $data);
        exit($xml->asXML());
    }
1286995
public function messageCustomSend($openid, $content, $type = self::MSG_TYPE_TEXT){

        //基础数据
        $data = array(
            'touser'=>$openid,
            'msgtype'=>$type,
        );

        //根据类型附加额外数据
        $data[$type] = call_user_func(array(self, $type), $content);

        return $this->api('message/custom/send', $data);
    }
863534
public function deleteAction($id, Request $request, $type = null)
    {
        $this->type = $type;

        return parent::deleteAction($id, $request);
    }
471162
public function set(string $id, string $content, array $options = [])
    {
        $options = array_intersect_key(self::$columns_options_def, $options) + self::$columns_options_def;
        $options['content'] = $content;
        $this->columns[$id] = $options;

        return $this;
    }
675919
public function update($id, $data, array $options = []) {
        return $this->query(Query::UPDATE)
            ->where($this->getPrimaryKey(), $id)
            ->save($data, $options);
    }