You are here

function farm_api_module_implements_alter in farmOS 7

Implements hook_module_implements_alter().

File

modules/farm/farm_api/farm_api.module, line 331
Farm API module.

Code

function farm_api_module_implements_alter(&$implementations, $hook) {

  // We only want to alter hook_restws_request_alter() implementations.
  if ($hook != 'restws_request_alter') {
    return;
  }

  // If either restws_file or farm_api don't implement the hook, bail.
  $modules = array(
    'restws_file',
    'farm_api',
  );
  foreach ($modules as $module) {
    if (!array_key_exists($module, $implementations)) {
      return;
    }
  }

  // Put farm_api's hook above restws_file's hook, so that our field aliasing
  // happens first.
  $implementations = array(
    'farm_api' => $implementations['farm_api'],
  ) + $implementations;
}