You are here

function cmis_vendor_invoke in CMIS API 7

Same name and namespace in other branches
  1. 6.4 cmis.module \cmis_vendor_invoke()
  2. 6 cmis.module \cmis_vendor_invoke()
  3. 6.2 cmis.module \cmis_vendor_invoke()
  4. 6.3 cmis.module \cmis_vendor_invoke()
  5. 7.2 cmis.module \cmis_vendor_invoke()

Utility function used to call a CMIS method, using the CMIS vendor selected in config.

Return value

mixed

40 calls to cmis_vendor_invoke()
cmisapi_addObjectToFolder in ./cmis.api.inc
cmisapi_applyPolicy in ./cmis.api.inc
cmisapi_cancelCheckOut in ./cmis.api.inc
cmisapi_checkIn in ./cmis.api.inc
cmisapi_checkOut in ./cmis.api.inc

... See full list

File

./cmis.module, line 177

Code

function cmis_vendor_invoke() {
  $vendor = variable_get('cmis_vendor', 'cmis_common');
  $args = func_get_args();
  $cmis_method = $args[0];
  $vendors = cmis_get_vendors();
  if (array_key_exists($vendor, $vendors)) {
    if (function_exists($vendor . '_cmisapi_invoke')) {
      return call_user_func_array($vendor . '_cmisapi_invoke', $args);
    }
    else {
      unset($args[0]);
      $function = $vendor . '_cmisapi_' . $cmis_method;
      if (function_exists($function)) {
        return call_user_func_array($function, $args);
      }
      throw new CMISException(t('@function not implemented by @vendor CMIS vendor', array(
        '@function' => $function,
        '@vendor' => $vendor,
      )));
    }
  }
  throw new CMISException(t('Unknown CMIS vendor: @vendor', array(
    '@vendor' => $vendor,
  )));
}