3

How can I specify in the spec for a new API that a parameter is an array? I looked at the activity api for an example since target contact id is detected as an array in the API explorer. However, my extension tables do not have a DAO so I cannot use 'FKClassName'.

  $params['target_contact_id'] = array(
    'name' => 'target_id',
    'title' => 'Activity Target',
    'description' => 'Contact(s) participating in this activity.',
    'type' => 1,
    'FKClassName' => 'CRM_Contact_DAO_Contact',
    'FKApiName' => 'Contact',
  );

This attempt below is not working.

function _civicrm_api3_myentity_myaction_spec(&$spec) {

  $spec['other_entities'] = array(
    'name' => 'other_entities',
    'title' => 'Other Entity(s)',
    'description' => 'Other entity(s) related to this entity.',
    'type' => 1,
  );
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.