You are here

function restws_field_collection_restws_response_alter in RESTful Web Services Field Collection 7

Implements hook_restws_response_alter().

File

./restws_field_collection.module, line 302
RESTful Web Services Field collection module.

Code

function restws_field_collection_restws_response_alter(&$response, $function, $formatName, $resourceController) {

  // If this is not JSON, bail.
  if ($formatName != 'json') {
    return;
  }

  // Get information about field collections.
  $field_collections = restws_field_collection_info();

  // Remove field collection fields from the response.
  foreach ($field_collections as $fc_name => $fc_info) {
    if (isset($response[$fc_name])) {
      unset($response[$fc_name]);
    }
  }
}