You are here

public function EntityResource::patch in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x src/Plugin/rest/resource/EntityResource.php \Drupal\cms_content_sync\Plugin\rest\resource\EntityResource::patch()
  2. 2.0.x src/Plugin/rest/resource/EntityResource.php \Drupal\cms_content_sync\Plugin\rest\resource\EntityResource::patch()

Responds to entity PATCH requests.

Parameters

string $api: The used content sync api

string $entity_type: The name of an entity type

string $entity_bundle: The name of an entity bundle

string $entity_type_version: The version of the entity type to compare ours against

string $entity_uuid: The uuid of an entity

array $data: The data to be stored in the entity

Return value

\Symfony\Component\HttpFoundation\Response A list of entities of the given type and bundle

Throws

\Drupal\cms_content_sync\Exception\SyncException

File

src/Plugin/rest/resource/EntityResource.php, line 222

Class

EntityResource
Provides entity interfaces for Content Sync, allowing Sync Core to request and manipulate entities.

Namespace

Drupal\cms_content_sync\Plugin\rest\resource

Code

public function patch($api, $entity_type, $entity_bundle, $entity_type_version, $entity_uuid, array $data) {
  return $this
    ->handleIncomingEntity($api, $entity_type, $entity_bundle, $entity_type_version, $data, SyncIntent::ACTION_UPDATE);
}