protected function SyncCoreEntityItemResource::respondWith in CMS Content Sync 2.1.x
Same name and namespace in other branches
- 2.0.x src/Plugin/rest/resource/SyncCoreEntityItemResource.php \Drupal\cms_content_sync\Plugin\rest\resource\SyncCoreEntityItemResource::respondWith()
2 calls to SyncCoreEntityItemResource::respondWith()
- SyncCoreEntityItemResource::get in src/
Plugin/ rest/ resource/ SyncCoreEntityItemResource.php - SyncCoreEntityItemResource::handleIncomingEntity in src/
Plugin/ rest/ resource/ SyncCoreEntityItemResource.php
File
- src/
Plugin/ rest/ resource/ SyncCoreEntityItemResource.php, line 257
Class
- SyncCoreEntityItemResource
- Provides entity interfaces for Content Sync, allowing Sync Core v2 to request and manipulate entities.
Namespace
Drupal\cms_content_sync\Plugin\rest\resourceCode
protected function respondWith($body, $status, $serialize = false) {
$response = new ModifiedResourceResponse($serialize ? null : $body, $status);
if ($serialize) {
$response
->setContent(json_encode($body));
}
return $response;
}