You are here

public function EntityResource::post 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::post()
  2. 2.0.x src/Plugin/rest/resource/EntityResource.php \Drupal\cms_content_sync\Plugin\rest\resource\EntityResource::post()

Responds to entity POST requests.

Parameters

string $api: The used content sync api

string $entity_type: The posted entity type

string $entity_bundle: The name of an entity bundle

string $entity_type_version: The version of the entity type

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 270

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 post($api, $entity_type, $entity_bundle, $entity_type_version, array $data) {
  return $this
    ->handleIncomingEntity($api, $entity_type, $entity_bundle, $entity_type_version, $data, SyncIntent::ACTION_CREATE);
}