You are here

function _services_entity_get_controller in Services Entity API 7.2

Gets an instance of the resource controller for an entity type.

Parameters

string $entity_type: The entity type.

Return value

ServicesEntityResourceControllerInterface A resource controller object.

3 calls to _services_entity_get_controller()
services_entity_services_resources in ./services_entity.services.inc
Implements of hook_services_resources().
_services_entity_access_callback in ./services_entity.resources.inc
Services access callback.
_services_entity_resource_callback in ./services_entity.resources.inc
Services resource callback.

File

./services_entity.module, line 150

Code

function _services_entity_get_controller($entity_type) {
  $info = entity_get_info($entity_type);
  if (isset($info['resource controller']) && class_exists($info['resource controller'])) {
    $class = $info['resource controller'];
  }
  else {
    $class = variable_get('services_entity_resource_class', 'ServicesEntityResourceController');
  }
  return new $class();
}