You are here

public function DeployServiceRestJSON::publish in Deploy - Content Staging 7.2

Same name and namespace in other branches
  1. 7.3 plugins/DeployServiceRestJSON.inc \DeployServiceRestJSON::publish()

Publish all entities in the $iterator. This method should only publish entities on the endpoint (if supported). The 'deploy' method is responsible for moving the entities to the endpoint, prior to the publishing.

Parameters

Traverable $iterator: This will usually be an object of a subclass of DeployAggregatorBase

Overrides DeployServiceRest::publish

See also

DeployService::deploy()

File

plugins/DeployServiceRestJSON.inc, line 36
JSON REST client for deploying entities.

Class

DeployServiceRestJSON
Class for deploying to a REST server using JSON

Code

public function publish(Traversable $iterator) {
  foreach ($iterator as $entity) {
    $this->config['headers']['Content-Type'] = 'application/json';

    // TODO: Consider making the resource path configurable.
    $url = $this->config['url'] . '/' . $entity->__metadata['uri'] . '/publish';

    //$this->httpRequest($url, 'POST');
  }
}