You are here

public function ServicesViewsApiTestCase::enableServiceViewResource in Services Views 7

Enable the endpoint resource related to a service type view display.

Parameters

object $endpoint: An endpoint object as defined by services_endpoint_load().

string $resource_name: The "path" display option on a Service view display.

File

tests/services_views.test, line 51

Class

ServicesViewsApiTestCase

Code

public function enableServiceViewResource($endpoint, $resource_name) {
  $endpoint->resources[$resource_name] = array(
    'operations' => array(
      'index' => array(
        'enabled' => 1,
      ),
    ),
  );
  services_endpoint_save($endpoint);

  // Good ole objects are passed by reference.
  $endpoint = services_endpoint_load($endpoint->name);
}