Changes between Initial Version and Version 1 of CiviCRM HowTo Develop API


Ignore:
Timestamp:
11/01/13 15:07:14 (11 years ago)
Author:
Richard Bramley
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CiviCRM HowTo Develop API

    v1 v1  
     1= CiviCRM API Development
     2
     3Just some quick notes for now:
     4
     51. API files live in the folder {{{{drupal}\sites\all\modules\civicrm\api\v3}}}
     61. Custom API files live in the folder {{{{civicrm custom folder}\api\v3}}} (CiviCRM custom folder is defined in the Civi menu Admininster >> System Settings >> Directories as {{{Custom PHP Path Directory}}}).  These files are used in preference to the ones in the standard folder above.
     71. The file name for API files should be Entity.php.  The function name is civicrm_api3_entity_action.
     81. The get methods seem to use a few standard mechanisms, some using functions in the file utils.php in the same api/v3 directory.
     91. One standard mechanism is that {{{_civicrm_api3_basic_create}}} function in the utils.php file.  This searches for entities, filtering by their field values.
     101. Quite a few use this method mixed, but add functionality to search for entities based on linked entities.  E.g, Activities can be found by contact_id, which is a relationship, not a field.  The two methods do not play nicely together.  For example, try searching for Activities by contact_id and activity_type_id - the activity_type_id filter will be ignored.