+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017 |
+ | Copyright CiviCRM LLC (c) 2004-2019 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
function _civicrm_api3_cxn_register_spec(&$spec) {
$daoFields = CRM_Cxn_DAO_Cxn::fields();
$spec['app_guid'] = $daoFields['app_guid'];
- $spec['app_meta_url'] = array(
+ $spec['app_meta_url'] = [
'name' => 'app_meta_url',
'type' => CRM_Utils_Type::T_STRING,
'title' => ts('Application Metadata URL'),
'description' => 'Application Metadata URL',
'maxlength' => 255,
'size' => CRM_Utils_Type::HUGE,
- );
+ ];
}
/**
}
}
elseif (!empty($params['app_guid'])) {
- $appMeta = civicrm_api3('CxnApp', 'getsingle', array(
+ $appMeta = civicrm_api3('CxnApp', 'getsingle', [
'appId' => $params['app_guid'],
- ));
+ ]);
}
if (empty($appMeta) || !is_array($appMeta)) {
$daoFields = CRM_Cxn_DAO_Cxn::fields();
$spec['cxn_guid'] = $daoFields['cxn_guid'];
$spec['app_guid'] = $daoFields['app_guid'];
- $spec['force'] = array(
+ $spec['force'] = [
'name' => 'force',
'type' => CRM_Utils_Type::T_BOOLEAN,
'title' => ts('Force'),
'description' => 'Destroy connection even if the remote application is non-responsive.',
'default' => '0',
- );
+ ];
}
/**
$cxnId = $params['cxn_guid'];
}
elseif (!empty($params['app_guid'])) {
- $cxnId = CRM_Core_DAO::singleValueQuery('SELECT cxn_guid FROM civicrm_cxn WHERE app_guid = %1', array(
- 1 => array($params['app_guid'], 'String'),
- ));
+ $cxnId = CRM_Core_DAO::singleValueQuery('SELECT cxn_guid FROM civicrm_cxn WHERE app_guid = %1', [
+ 1 => [$params['app_guid'], 'String'],
+ ]);
if (!$cxnId) {
throw new API_Exception("The app_guid does not correspond to an active connection.");
}
$daoFields = CRM_Cxn_DAO_Cxn::fields();
$spec['app_guid'] = $daoFields['app_guid'];
$spec['cxn_guid'] = $daoFields['cxn_guid'];
- $spec['page_name'] = array(
+ $spec['page_name'] = [
'name' => 'page_name',
'type' => CRM_Utils_Type::T_STRING,
'title' => ts('Page Type'),
'description' => 'The type of page (eg "settings")',
'maxlength' => 63,
'size' => CRM_Utils_Type::HUGE,
- 'api.aliases' => array('page'),
- );
+ 'api.aliases' => ['page'],
+ ];
}
/**
/** @var \Civi\Cxn\Rpc\RegistrationClient $client */
$client = \Civi::service('cxn_reg_client');
- return $client->call($appMeta, 'Cxn', 'getlink', array(
+ return $client->call($appMeta, 'Cxn', 'getlink', [
'page' => $params['page_name'],
- ));
+ ]);
}
/**
* @throws Exception
*/
function civicrm_api3_cxn_getcfg($params) {
- $result = array(
+ $result = [
'CIVICRM_CXN_CA' => defined('CIVICRM_CXN_CA') ? CIVICRM_CXN_CA : NULL,
'CIVICRM_CXN_VIA' => defined('CIVICRM_CXN_VIA') ? CIVICRM_CXN_VIA : NULL,
'CIVICRM_CXN_APPS_URL' => defined('CIVICRM_CXN_APPS_URL') ? CIVICRM_CXN_APPS_URL : NULL,
'siteCallbackUrl' => CRM_Cxn_BAO_Cxn::getSiteCallbackUrl(),
- );
+ ];
return civicrm_api3_create_success($result);
}
return civicrm_api3_create_success($result, $params, 'Cxn', 'create');
}
- catch(Exception $ex){
+ catch (Exception $ex) {
throw $ex;
}
}