My Google Sheets PHP API repeatcell
запрос не обновляет свойства ячейки.
Существует ли какая-либо рабочая альтернатива для обновления свойств ячейки, таких как текст, выделенный полужирным шрифтом, цвет фона и т. Д .?
Есть ли надлежащая документация по API Google Spreadsheet PHP?
Я использую "google / apiclient": "^ 2.0".
Это код, который я использовал, и ответ, который я получил:
$sheetId = $service->spreadsheets->get($spreadsheetId, ['ranges' => 'SLA Data!A1']);
$range = new Google_Service_Sheets_GridRange();
$range->setSheetId($sheetId->sheets[0]->properties->sheetId);
$range->setEndRowIndex(2);
$range->setEndRowIndex(5);
$range->setStartColumnIndex(0);
$range->setEndColumnIndex(5);
$cell = new Google_Service_Sheets_CellData();
$cellFormat = new Google_Service_Sheets_CellFormat();
$textFormat = new Google_Service_Sheets_TextFormat();
$textFormat->setBold(true);
$cellFormat->setTextFormat($textFormat);
$cell->setUserEnteredFormat($cellFormat);
$repeatCell = new Google_Service_Sheets_RepeatCellRequest();
$repeatCell->setRange($range);
$repeatCell->setFields('userEnteredFormat.textFormat.bold');
$requests = new Google_Service_Sheets_Request();
$requests->setRepeatCell($repeatCell);
$batchUpdateRequest = new Google_Service_Sheets_BatchUpdateSpreadsheetRequest();
$batchUpdateRequest->setRequests($requests);
Код ответа:
Google_Service_Sheets_BatchUpdateSpreadsheetResponse Object
(
[collection_key:protected] => replies
[repliesType:protected] => Google_Service_Sheets_Response
[repliesDataType:protected] => array
[spreadsheetId] => 1ZlQPGuI0q0bIDAsbl04BALb8_sqXm02aPY0ZCEyeTHc
[updatedSpreadsheetType:protected] => Google_Service_Sheets_Spreadsheet
[updatedSpreadsheetDataType:protected] =>
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[replies] => Array
(
[0] => Google_Service_Sheets_Response Object
(
[addBandingType:protected] => Google_Service_Sheets_AddBandingResponse
[addBandingDataType:protected] =>
[addChartType:protected] => Google_Service_Sheets_AddChartResponse
[addChartDataType:protected] =>
[addDimensionGroupType:protected] => Google_Service_Sheets_AddDimensionGroupResponse
[addDimensionGroupDataType:protected] =>
[addFilterViewType:protected] => Google_Service_Sheets_AddFilterViewResponse
[addFilterViewDataType:protected] =>
[addNamedRangeType:protected] => Google_Service_Sheets_AddNamedRangeResponse
[addNamedRangeDataType:protected] =>
[addProtectedRangeType:protected] => Google_Service_Sheets_AddProtectedRangeResponse
[addProtectedRangeDataType:protected] =>
[addSheetType:protected] => Google_Service_Sheets_AddSheetResponse
[addSheetDataType:protected] =>
[createDeveloperMetadataType:protected] => Google_Service_Sheets_CreateDeveloperMetadataResponse
[createDeveloperMetadataDataType:protected] =>
[deleteConditionalFormatRuleType:protected] => Google_Service_Sheets_DeleteConditionalFormatRuleResponse
[deleteConditionalFormatRuleDataType:protected] =>
[deleteDeveloperMetadataType:protected] => Google_Service_Sheets_DeleteDeveloperMetadataResponse
[deleteDeveloperMetadataDataType:protected] =>
[deleteDimensionGroupType:protected] => Google_Service_Sheets_DeleteDimensionGroupResponse
[deleteDimensionGroupDataType:protected] =>
[duplicateFilterViewType:protected] => Google_Service_Sheets_DuplicateFilterViewResponse
[duplicateFilterViewDataType:protected] =>
[duplicateSheetType:protected] => Google_Service_Sheets_DuplicateSheetResponse
[duplicateSheetDataType:protected] =>
[findReplaceType:protected] => Google_Service_Sheets_FindReplaceResponse
[findReplaceDataType:protected] =>
[updateConditionalFormatRuleType:protected] => Google_Service_Sheets_UpdateConditionalFormatRuleResponse
[updateConditionalFormatRuleDataType:protected] =>
[updateDeveloperMetadataType:protected] => Google_Service_Sheets_UpdateDeveloperMetadataResponse
[updateDeveloperMetadataDataType:protected] =>
[updateEmbeddedObjectPositionType:protected] => Google_Service_Sheets_UpdateEmbeddedObjectPositionResponse
[updateEmbeddedObjectPositionDataType:protected] =>
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
)
)
)