* API result array
*/
function activity_get_example() {
- $params = array(
+ $params = [
'activity_id' => 1,
'sequential' => 1,
'return.assignee_contact_id' => 1,
- 'api.contact.get' => array(
+ 'api.contact.get' => [
'id' => '$value.source_contact_id',
- ),
- );
+ ],
+ ];
try{
$result = civicrm_api3('Activity', 'get', $params);
$errorMessage = $e->getMessage();
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
- return array(
+ return [
'is_error' => 1,
'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
- );
+ ];
}
return $result;
*/
function activity_get_expectedresult() {
- $expectedResult = array(
+ $expectedResult = [
'is_error' => 0,
'version' => 3,
'count' => 1,
'id' => 1,
- 'values' => array(
- '0' => array(
+ 'values' => [
+ '0' => [
'id' => '1',
- 'activity_type_id' => '51',
+ 'activity_type_id' => '9999',
'subject' => 'test activity type id',
'activity_date_time' => '2011-06-02 14:36:13',
'duration' => '120',
'is_current_revision' => '1',
'is_deleted' => 0,
'is_star' => 0,
- 'assignee_contact_id' => array(
+ 'assignee_contact_id' => [
'0' => '3',
- ),
+ ],
'source_contact_id' => '1',
- 'api.contact.get' => array(
+ 'api.contact.get' => [
'is_error' => 0,
'version' => 3,
'count' => 1,
'id' => 1,
- 'values' => array(
- '0' => array(
+ 'values' => [
+ '0' => [
'contact_id' => '1',
'contact_type' => 'Individual',
'contact_sub_type' => '',
'street_address' => '',
'supplemental_address_1' => '',
'supplemental_address_2' => '',
+ 'supplemental_address_3' => '',
'city' => '',
'postal_code_suffix' => '',
'postal_code' => '',
'im' => '',
'worldregion_id' => '',
'world_region' => '',
+ 'languages' => 'English (United States)',
'individual_prefix' => 'Mr.',
'individual_suffix' => 'II',
'communication_style' => '',
'state_province' => '',
'country' => '',
'id' => '1',
- ),
- ),
- ),
- ),
- ),
- );
+ ],
+ ],
+ ],
+ ],
+ ],
+ ];
return $expectedResult;
}