Merge pull request #19727 from totten/master-authx-rest
[civicrm-core.git] / api / v3 / Entity.php
index 03453eb8355351272e5c0963f4b7f02f3677d25f..fba4b7eb1a59ac73bcf68c65f4f861b8d1eba9a6 100644 (file)
@@ -3,15 +3,19 @@
 /**
  * Get list of deprecated entities.
  *
+ * This is called by the api wrapper when returning the result of api.Entity.get.
+ *
  * @param array $entities
  *
  * @return array
  *   Array of deprecated api entities
  */
 function _civicrm_api3_entity_deprecation($entities) {
-  $deprecated = array();
+  $deprecated = [];
   if (!empty($entities['values'])) {
     foreach ($entities['values'] as $entity) {
+      $apiFile = "api/v3/$entity.php";
+      @include_once $apiFile;
       if (is_string(_civicrm_api3_deprecation_check($entity))) {
         $deprecated[] = $entity;
       }
@@ -58,5 +62,5 @@ function civicrm_api3_entity_delete($params) {
 function civicrm_api3_entity_getfields($params) {
   // we return an empty array so it makes it easier to write generic getdefaults / required tests
   // without putting an exception in for entity
-  return civicrm_api3_create_success(array());
+  return civicrm_api3_create_success([]);
 }