APIv4 - Cache SchemaMap in Civi::cache('metadata')
[civicrm-core.git] / Civi / Api4 / Action / Entity / GetLinks.php
index e0458b56b59974b483dea52ddf3d4ea526548eb9..3408fea35be52113567bf5f1ca100d51a036dcf8 100644 (file)
@@ -25,8 +25,7 @@ class GetLinks extends \Civi\Api4\Generic\BasicGetAction {
   public function getRecords() {
     \CRM_Core_Error::deprecatedWarning('APIv4 Entity::getLinks is deprecated.');
     $result = [];
-    /** @var \Civi\Api4\Service\Schema\SchemaMap $schema */
-    $schema = \Civi::container()->get('schema_map');
+    $schema = CoreUtil::getSchemaMap();
     foreach ($schema->getTables() as $table) {
       $entity = CoreUtil::getApiNameFromTableName($table->getName());
       // Since this is an api function, exclude tables that don't have an api