Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/v3/ChatAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function _civicrm_api3_chat_action_create_spec(&$spec) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_action_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand All @@ -29,7 +29,7 @@ function civicrm_api3_chat_action_create($params) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_action_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand All @@ -40,7 +40,7 @@ function civicrm_api3_chat_action_delete($params) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_action_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand Down
6 changes: 3 additions & 3 deletions api/v3/ChatCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function _civicrm_api3_chat_cache_create_spec(&$spec) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_cache_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand All @@ -29,7 +29,7 @@ function civicrm_api3_chat_cache_create($params) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_cache_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand All @@ -40,7 +40,7 @@ function civicrm_api3_chat_cache_delete($params) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_cache_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand Down
6 changes: 3 additions & 3 deletions api/v3/ChatConversationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function _civicrm_api3_chat_conversation_type_create_spec(&$spec) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_conversation_type_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand All @@ -30,7 +30,7 @@ function civicrm_api3_chat_conversation_type_create($params) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_conversation_type_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand All @@ -41,7 +41,7 @@ function civicrm_api3_chat_conversation_type_delete($params) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_conversation_type_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand Down
6 changes: 3 additions & 3 deletions api/v3/ChatHear.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function _civicrm_api3_chat_hear_create_spec(&$spec) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_hear_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand All @@ -29,7 +29,7 @@ function civicrm_api3_chat_hear_create($params) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_hear_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand All @@ -40,7 +40,7 @@ function civicrm_api3_chat_hear_delete($params) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_hear_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand Down
6 changes: 3 additions & 3 deletions api/v3/ChatQuestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function _civicrm_api3_chat_question_create_spec(&$spec) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_question_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand All @@ -29,7 +29,7 @@ function civicrm_api3_chat_question_create($params) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_question_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand All @@ -40,7 +40,7 @@ function civicrm_api3_chat_question_delete($params) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_question_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand Down
6 changes: 3 additions & 3 deletions api/v3/ChatUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function _civicrm_api3_chat_user_create_spec(&$spec) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_user_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand All @@ -29,7 +29,7 @@ function civicrm_api3_chat_user_create($params) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_user_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand All @@ -40,7 +40,7 @@ function civicrm_api3_chat_user_delete($params) {
*
* @param array $params
* @return array API result descriptor
* @throws API_Exception
* @throws CRM_Core_Exception
*/
function civicrm_api3_chat_user_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
Expand Down
4 changes: 2 additions & 2 deletions api/v3/Contact/Say.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function civicrm_api3_contact_say($params) {
$missingFields = array_diff($required, array_keys($params));

if(count($missingFields)){
throw new API_Exception('Mandatory key(s) missing from params array: ' . implode(', ', $missingFields));
throw new CRM_Core_Exception('Mandatory key(s) missing from params array: ' . implode(', ', $missingFields));
}

try {
Expand All @@ -21,7 +21,7 @@ function civicrm_api3_contact_say($params) {
'contact_id' => $params['id']
]);
} catch (\Exception $e) {
throw new API_Exception("Could not find {$params['service']} user for contact_id {$params['id']}");
throw new CRM_Core_Exception("Could not find {$params['service']} user for contact_id {$params['id']}");
}

$botman = CRM_Chat_Botman::get($params['service']);
Expand Down
4 changes: 2 additions & 2 deletions api/v3/Contact/StartConversation.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function civicrm_api3_contact_start_conversation($params) {
$missingFields = array_diff($required, array_keys($params));

if(count($missingFields)){
throw new API_Exception('Mandatory key(s) missing from params array: ' . implode(', ', $missingFields));
throw new CRM_Core_Exception('Mandatory key(s) missing from params array: ' . implode(', ', $missingFields));
}

// Check user has account with service
Expand All @@ -23,7 +23,7 @@ function civicrm_api3_contact_start_conversation($params) {
'contact_id' => $params['id']
]);
} catch (\Exception $e) {
throw new API_Exception("Could not find {$params['service']} user for contact_id {$params['id']}");
throw new CRM_Core_Exception("Could not find {$params['service']} user for contact_id {$params['id']}");
}

$conversationType = CRM_Chat_BAO_ChatConversationType::findById($params['conversation_type_id']);
Expand Down