public function TripalWebService::setResource

3.x TripalWebService.inc public TripalWebService::setResource($resource)

Sets the resource to be returned by this web service.

Parameters

$resource.: An implementation of a TripalWebServiceResource.

File

tripal_ws/includes/TripalWebService.inc, line 294

Class

TripalWebService

Code

public function setResource($resource) {
  // Make sure the $servcie provides is a TripalWebServcie class.
  if (!is_a($resource, 'TripalWebServiceResource')) {
    throw new Exception("Cannot add a new resource to this web service as it is not a TripalWebServiceResource.");
  }

  $this->resource = $resource;
}