public function TripalWebServiceCollection::__construct

3.x TripalWebServiceCollection.inc public TripalWebServiceCollection::__construct($service_path, $params)

Implements the constructor.

Parameters

TripalWebService $service: An instance of a TripalWebService or class that extends it.

Overrides TripalWebServiceResource::__construct

File

tripal_ws/includes/TripalWebServiceCollection.inc, line 49

Class

TripalWebServiceCollection

Code

public function __construct($service_path, $params) {
  parent::__construct($service_path);

  // Initialize private member variables.
  $this->params = $params;
  $this->members = array();

  // Add some terms to the context.
  $this->addContextItem('Collection', 'hydra:Collection');
  $this->addContextItem('totalItems', 'hydra:totalItems');
  $this->addContextItem('member', 'hydra:member');
  parent::setType('Collection');

  // If the totalItems is set to -1 then this means paging is turned off and
  // all of the elements in the $memgbers array should be used.
  $this->totalItems = 0;
  $this->itemsPerPage = 25;
  $this->doPaging = FALSE;
}