Merge pull request #3679 from yashodha/CRM-14951
[civicrm-core.git] / api / v3 / Entity.php
index 3a38c7961ae01206ee0b54f76d1781eef1408467..e0c30dbf80947f72b677e58f76899388f57578ca 100644 (file)
@@ -1,47 +1,5 @@
 <?php
 
-require_once 'api/v3/utils.php';
-
-/**
- *  returns the list of all the entities that you can manipulate via the api. The entity of this API call is the entity, that isn't a real civicrm entity as in something stored in the DB, but an abstract meta object. My head is going to explode. In a meta way.
- */
-function civicrm_api3_entity_get($params) {
-
-  civicrm_api3_verify_mandatory($params);
-  $entities = array();
-  $include_dirs = array_unique(explode(PATH_SEPARATOR, get_include_path()));
-  #$include_dirs = array(dirname(__FILE__). '/../../');
-  foreach ($include_dirs as $include_dir) {
-    $api_dir = implode(DIRECTORY_SEPARATOR, array($include_dir, 'api', 'v3'));
-    if (! is_dir($api_dir)) {
-      continue;
-    }
-    $iterator = new DirectoryIterator($api_dir);
-  foreach ($iterator as $fileinfo) {
-    $file = $fileinfo->getFilename();
-
-      // Check for entities with a master file ("api/v3/MyEntity.php")
-    $parts = explode(".", $file);
-      if (end($parts) == "php" && $file != "utils.php" && !preg_match('/Tests?.php$/', $file) ) {
-      // without the ".php"
-      $entities[] = substr($file, 0, -4);
-    }
-
-      // Check for entities with standalone action files ("api/v3/MyEntity/MyAction.php")
-      $action_dir = $api_dir . DIRECTORY_SEPARATOR . $file;
-      if (preg_match('/^[A-Z][A-Za-z0-9]*$/', $file) && is_dir($action_dir)) {
-        if (count(glob("$action_dir/[A-Z]*.php")) > 0) {
-          $entities[] = $file;
-  }
-      }
-    }
-  }
-  $entities = array_diff($entities, array('Generic'));
-  $entities = array_unique($entities);
-  sort($entities);
-  return civicrm_api3_create_success($entities);
-}
-
 /**
  *  Placeholder function. This should never be called, as it doesn't have any meaning
  */