public function DeployRemoteCcServiceRestJSON::deploy in Deploy - Content Staging 7.3
Deploy all entities in the $iterator. This method should only move entities over to the endpoint and create unpublished revisions (if supported). The 'publish' method is responsible for publishing all successfully deployed entities.
Parameters
Traverable $iterator: This will usually be an object of a subclass of DeployAggregatorBase
Overrides DeployServiceRest::deploy
See also
File
- modules/
deploy_remote_cc/ plugins/ DeployRemoteCcServiceRestJSON.inc, line 27
Class
- DeployRemoteCcServiceRestJSON
- Class for calling Rest Service.
Code
public function deploy(\Traversable $entities) {
foreach ($entities->entities as $entity) {
$this->config['headers']['Content-Type'] = 'application/json';
// We only want the scheme and host part of any saved URL.
$url = parse_url($this->config['url']);
$url = $url['scheme'] . "://" . $url['host'] . "/";
$url .= $entities
->buildPath(array(
$entity,
));
$this
->httpRequest($url, 'PUT');
}
}