本文整理匯總了PHP中Buzz\Browser::patch方法的典型用法代碼示例。如果您正苦於以下問題:PHP Browser::patch方法的具體用法?PHP Browser::patch怎麽用?PHP Browser::patch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Buzz\Browser
的用法示例。
在下文中一共展示了Browser::patch方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: updateRecord
/**
* This will update some (but not all) fields of a table record, issuing a PATCH request to the record endpoint. Any fields that are not included will not be updated.
*
* @param string $table
* @param array $criteria
* @param array $fields
*/
public function updateRecord($table, array $criteria = [], array $fields)
{
$record = $this->findRecord($table, $criteria);
/** @var Response $response */
$response = $this->browser->patch($this->getEndpoint($table, $record->getId()), ["content-type" => "application/json"], json_encode(["fields" => $fields]));
$this->guardResponse($table, $response);
}