You are here

function cmis_vendor_invoke in CMIS API 6.2

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

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

Return value

mixed

35 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 24

Code

function cmis_vendor_invoke() {
  $vendor = variable_get('cmis_vendor', NULL);
  if (is_null($vendor)) {
    throw new CMISException(t('CMIS module not configured'));
  }
  $args = func_get_args();
  $cmis_method = $args[0];
  $vendors = cmis_get_vendors();
  if (array_key_exists($vendor, $vendors)) {
    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,
  )));
}