Zendesk\API\Traits\Resource\UpdateMany::updateMany PHP Method

updateMany() public method

Update group of resources
public updateMany ( array $params, string $key = 'ids' ) : stdClass
$params array
$key string Could be `id` or `external_id`
return stdClass | null
    public function updateMany(array $params, $key = 'ids')
    {
        try {
            $route = $this->getRoute(__FUNCTION__);
        } catch (RouteException $e) {
            if (!isset($this->resourceName)) {
                $this->resourceName = $this->getResourceNameFromClass();
            }
            $route = $this->resourceName . '/update_many.json';
            $this->setRoute('updateMany', $route);
        }
        $resourceUpdateName = $this->objectNamePlural;
        $queryParams = [];
        if (isset($params[$key]) && is_array($params[$key])) {
            $queryParams[$key] = implode(',', $params[$key]);
            unset($params[$key]);
            $resourceUpdateName = $this->objectName;
        }
        $response = Http::send($this->client, $route, ['queryParams' => $queryParams, 'postFields' => [$resourceUpdateName => $params], 'method' => 'PUT']);
        $this->client->setSideload(null);
        return $response;
    }
UpdateMany