From 74aaa74d7651f8c844fb5b0a9e27d7c46f6920a8 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 7 May 2020 10:23:55 -0400 Subject: [PATCH] APIv4 - Remove unused vars & uncalled methods. YAGNI. --- Civi/Api4/Query/Api4SelectQuery.php | 43 ------------------------- Civi/Api4/Service/Schema/Joiner.php | 1 - Civi/Api4/Service/Spec/SpecGatherer.php | 8 ----- 3 files changed, 52 deletions(-) diff --git a/Civi/Api4/Query/Api4SelectQuery.php b/Civi/Api4/Query/Api4SelectQuery.php index 26e12fedbc..0e91377545 100644 --- a/Civi/Api4/Query/Api4SelectQuery.php +++ b/Civi/Api4/Query/Api4SelectQuery.php @@ -13,7 +13,6 @@ namespace Civi\Api4\Query; use Civi\API\SelectQuery; use Civi\Api4\Service\Schema\Joinable\CustomGroupJoinable; -use Civi\Api4\Service\Schema\Joinable\Joinable; use Civi\Api4\Utils\FormattingUtil; use Civi\Api4\Utils\CoreUtil; use Civi\Api4\Utils\SelectUtil; @@ -39,12 +38,6 @@ class Api4SelectQuery extends SelectQuery { */ protected $apiVersion = 4; - /** - * @var \Civi\Api4\Service\Schema\Joinable\Joinable[] - * The joinable tables that have been joined so far - */ - protected $joinedTables = []; - /** * @var array * [alias => expr][] @@ -435,17 +428,6 @@ class Api4SelectQuery extends SelectQuery { } } - /** - * @param \Civi\Api4\Service\Schema\Joinable\Joinable $joinable - * - * @return $this - */ - public function addJoinedTable(Joinable $joinable) { - $this->joinedTables[] = $joinable; - - return $this; - } - /** * @return FALSE|string */ @@ -502,13 +484,6 @@ class Api4SelectQuery extends SelectQuery { return $this->selectFields; } - /** - * @return bool - */ - public function isFillUniqueFields() { - return $this->isFillUniqueFields; - } - /** * @return \CRM_Utils_SQL_Select */ @@ -558,24 +533,6 @@ class Api4SelectQuery extends SelectQuery { return $this->apiVersion; } - /** - * @return \Civi\Api4\Service\Schema\Joinable\Joinable[] - */ - public function getJoinedTables() { - return $this->joinedTables; - } - - /** - * @return \Civi\Api4\Service\Schema\Joinable\Joinable - */ - public function getJoinedTable($alias) { - foreach ($this->joinedTables as $join) { - if ($join->getAlias() == $alias) { - return $join; - } - } - } - /** * Get table name on basis of entity * diff --git a/Civi/Api4/Service/Schema/Joiner.php b/Civi/Api4/Service/Schema/Joiner.php index 58bb850ce6..8442da9112 100644 --- a/Civi/Api4/Service/Schema/Joiner.php +++ b/Civi/Api4/Service/Schema/Joiner.php @@ -63,7 +63,6 @@ class Joiner { $conditions = $link->getConditionsForJoin($baseTable); $query->join($side, $target, $alias, $conditions); - $query->addJoinedTable($link); $baseTable = $link->getAlias(); } diff --git a/Civi/Api4/Service/Spec/SpecGatherer.php b/Civi/Api4/Service/Spec/SpecGatherer.php index d9909c477d..798779a879 100644 --- a/Civi/Api4/Service/Spec/SpecGatherer.php +++ b/Civi/Api4/Service/Spec/SpecGatherer.php @@ -14,7 +14,6 @@ * * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing - * $Id$ * */ @@ -32,13 +31,6 @@ class SpecGatherer { */ protected $specProviders = []; - /** - * A cache of DAOs based on entity - * - * @var \CRM_Core_DAO[] - */ - protected $DAONames; - /** * Returns a RequestSpec with all the fields available. Uses spec providers * to add or modify field specifications. -- 2.25.1