From: colemanw Date: Fri, 8 Dec 2023 02:04:05 +0000 (-0500) Subject: APIv4 - Delete unused Entity::getLinks action X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fdcc0e25157bbcb576940cf2784a30ece00d33ae;p=civicrm-core.git APIv4 - Delete unused Entity::getLinks action This api action was never used outside core, and has been deprecated for a year and a half. --- diff --git a/Civi/Api4/Action/Entity/GetLinks.php b/Civi/Api4/Action/Entity/GetLinks.php deleted file mode 100644 index e05d66de1e..0000000000 --- a/Civi/Api4/Action/Entity/GetLinks.php +++ /dev/null @@ -1,64 +0,0 @@ -getTables() as $table) { - $entity = CoreUtil::getApiNameFromTableName($table->getName()); - // Since this is an api function, exclude tables that don't have an api - if ($entity) { - $item = [ - 'entity' => $entity, - 'table' => $table->getName(), - 'links' => [], - ]; - foreach ($table->getTableLinks() as $link) { - if (!$link->isDeprecatedBy()) { - $item['links'][] = $link->toArray(); - } - } - $result[] = $item; - } - } - return $result; - } - - public function fields() { - return [ - [ - 'name' => 'entity', - ], - [ - 'name' => 'table', - ], - [ - 'name' => 'links', - 'data_type' => 'Array', - ], - ]; - } - -} diff --git a/Civi/Api4/Entity.php b/Civi/Api4/Entity.php index a595df8575..50f37871ac 100644 --- a/Civi/Api4/Entity.php +++ b/Civi/Api4/Entity.php @@ -173,16 +173,6 @@ class Entity extends Generic\AbstractEntity { ->setCheckPermissions($checkPermissions); } - /** - * @param bool $checkPermissions - * @deprecated - * @return Action\Entity\GetLinks - */ - public static function getLinks($checkPermissions = TRUE) { - return (new Action\Entity\GetLinks('Entity', __FUNCTION__)) - ->setCheckPermissions($checkPermissions); - } - /** * @return array */ diff --git a/tests/phpunit/api/v4/Action/ChainTest.php b/tests/phpunit/api/v4/Action/ChainTest.php index 2f2a8a6a5a..7cd87deab0 100644 --- a/tests/phpunit/api/v4/Action/ChainTest.php +++ b/tests/phpunit/api/v4/Action/ChainTest.php @@ -59,7 +59,7 @@ class ChainTest extends Api4TestBase implements TransactionalInterface { ->indexBy('name'); $this->assertArrayHasKey('replace', $entities['Contact']['actions']); - $this->assertArrayHasKey('getLinks', $entities['Entity']['actions']); + $this->assertArrayHasKey('autocomplete', $entities['Entity']['actions']); $this->assertArrayNotHasKey('replace', $entities['Entity']['actions']); }