4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC. All rights reserved. |
7 | This work is published under the GNU AGPLv3 license with some |
8 | permitted exceptions and without any warranty. For full license |
9 | and copyright information, see https://civicrm.org/licensing |
10 +--------------------------------------------------------------------+
13 namespace Civi\Api4\Action\Entity
;
15 use Civi\Api4\Utils\CoreUtil
;
18 * Get a list of FK links between entities.
20 * This action is deprecated; the API no longer uses these links to determine available joins.
23 class GetLinks
extends \Civi\Api4\Generic\BasicGetAction
{
25 public function getRecords() {
26 \CRM_Core_Error
::deprecatedWarning('APIv4 Entity::getLinks is deprecated.');
28 $schema = CoreUtil
::getSchemaMap();
29 foreach ($schema->getTables() as $table) {
30 $entity = CoreUtil
::getApiNameFromTableName($table->getName());
31 // Since this is an api function, exclude tables that don't have an api
35 'table' => $table->getName(),
38 foreach ($table->getTableLinks() as $link) {
39 if (!$link->isDeprecated()) {
40 $item['links'][] = $link->toArray();
49 public function fields() {
59 'data_type' => 'Array',