<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
try {
/** @var \Civi\Cxn\Rpc\RegistrationClient $client */
- $client = \Civi\Core\Container::singleton()->get('cxn_reg_client');
+ $client = \Civi::service('cxn_reg_client');
list($cxnId, $result) = $client->register($appMeta);
CRM_Cxn_BAO_Cxn::updateAppMeta($appMeta);
}
return $result;
}
+/**
+ * Adjust metadata for cxn unregister.
+ *
+ * @param array $spec
+ */
function _civicrm_api3_cxn_unregister_spec(&$spec) {
$daoFields = CRM_Cxn_DAO_Cxn::fields();
$spec['cxn_guid'] = $daoFields['cxn_guid'];
$appMeta = CRM_Cxn_BAO_Cxn::getAppMeta($cxnId);
/** @var \Civi\Cxn\Rpc\RegistrationClient $client */
- $client = \Civi\Core\Container::singleton()->get('cxn_reg_client');
+ $client = \Civi::service('cxn_reg_client');
list($cxnId, $result) = $client->unregister($appMeta, CRM_Utils_Array::value('force', $params, FALSE));
return $result;
return $cxnId;
}
+/**
+ * Adjust metadata for cxn get action.
+ *
+ * @param array $spec
+ */
function _civicrm_api3_cxn_get_spec(&$spec) {
// Don't trust AJAX callers or other external code to modify, filter, or return the secret.
unset($spec['secret']);
}
/** @var \Civi\Cxn\Rpc\RegistrationClient $client */
- $client = \Civi\Core\Container::singleton()->get('cxn_reg_client');
+ $client = \Civi::service('cxn_reg_client');
return $client->call($appMeta, 'Cxn', 'getlink', array(
'page' => $params['page'],
));