Merge pull request #6574 from eileenmcnaughton/CRM-17070
[civicrm-core.git] / api / v3 / Extension.php
index 11a2932f5aafbde9e8c279bb8820d054e7b72fe3..2fe2bd7258f67b8e99f5ace29ef651de1efe5209 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
@@ -254,17 +254,19 @@ function civicrm_api3_extension_get($params) {
   $statuses = CRM_Extension_System::singleton()->getManager()->getStatuses();
   $mapper = CRM_Extension_System::singleton()->getMapper();
   $result = array();
+  $id = 0;
   foreach ($statuses as $key => $status) {
     //try {
     //  $info = (array) $mapper->keyToInfo($key);
     //} catch (CRM_Extension_Exception $e) {
     $info = array();
+    $info['id'] = $id++; // backward compatibility with indexing scheme
     $info['key'] = $key;
     //}
     $info['status'] = $status;
     $result[] = $info;
   }
-  return civicrm_api3_create_success($result);
+  return _civicrm_api3_basic_array_get('Extension', $params, $result, 'id', array('id', 'key', 'status'));
 }
 
 /**