public function DrupalApplication::getRestUrl in CMS Content Sync 8
Same name and namespace in other branches
- 2.1.x src/SyncCoreInterface/DrupalApplication.php \Drupal\cms_content_sync\SyncCoreInterface\DrupalApplication::getRestUrl()
- 2.0.x src/SyncCoreInterface/DrupalApplication.php \Drupal\cms_content_sync\SyncCoreInterface\DrupalApplication::getRestUrl()
File
- src/
SyncCoreInterface/ DrupalApplication.php, line 65
Class
- DrupalApplication
- Class DrupalApplication.
Namespace
Drupal\cms_content_sync\SyncCoreInterfaceCode
public function getRestUrl($pool_id, $type_machine_name, $bundle_machine_name, $version_id, $entity_uuid = null, $manually = null, $as_dependency = null) {
$export_url = $this
->getSiteBaseUrl();
$url = sprintf('%s/rest/cms-content-sync/%s/%s/%s/%s', $export_url, $pool_id, $type_machine_name, $bundle_machine_name, $version_id);
if ($entity_uuid) {
$url .= '/' . $entity_uuid;
}
$url .= '?_format=json';
if ($as_dependency) {
$url .= '&is_dependency=' . $as_dependency;
}
if ($manually) {
$url .= '&is_manual=' . $manually;
}
return $url;
}