3 * Test Generated example demonstrating the Contact.getactions API.
5 * Getting the available actions for an entity.
10 function contact_getactions_example() {
14 $result = civicrm_api3('Contact', 'getactions', $params);
16 catch (CiviCRM_API3_Exception
$e) {
18 $errorMessage = $e->getMessage();
19 $errorCode = $e->getErrorCode();
20 $errorData = $e->getExtraParams();
23 'error_message' => $errorMessage,
24 'error_code' => $errorCode,
25 'error_data' => $errorData,
33 * Function returns array of result expected from previous function.
38 function contact_getactions_expectedresult() {
40 $expectedResult = array(
47 '2' => 'duplicatecheck',
56 '11' => 'getrefcount',
66 'deprecated' => array(
67 'getquick' => 'The "getquick" action is deprecated in favor of "getlist".',
68 'setvalue' => 'The "setvalue" action is deprecated. Use "create" with an id instead.',
69 'update' => 'The "update" action is deprecated. Use "create" with an id instead.',
73 return $expectedResult;
77 * This example has been generated from the API test suite.
78 * The test that created it is called "testGetActions"
79 * and can be found at:
80 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
82 * You can see the outcome of the API tests at
83 * https://test.civicrm.org/job/CiviCRM-master-git/
85 * To Learn about the API read
86 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
88 * Browse the api on your own site with the api explorer
89 * http://MYSITE.ORG/path/to/civicrm/api
91 * Read more about testing here
92 * http://wiki.civicrm.org/confluence/display/CRM/Testing
94 * API Standards documentation:
95 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards