diff --git a/application/Espo/Tools/Kanban/Api/GetData.php b/application/Espo/Tools/Kanban/Api/GetData.php index 1412af5c98..b91a23ef61 100644 --- a/application/Espo/Tools/Kanban/Api/GetData.php +++ b/application/Espo/Tools/Kanban/Api/GetData.php @@ -58,8 +58,7 @@ class GetData implements ActionAlias return ResponseComposer::json([ 'total' => $result->getTotal(), - 'list' => $result->getCollection()->getValueMapList(), - 'groups' => array_map(fn ($it) => $it->toRaw(), $result->getGroupList()), + 'groups' => array_map(fn ($it) => $it->toRaw(), $result->getGroups()), ]); } } diff --git a/application/Espo/Tools/Kanban/Kanban.php b/application/Espo/Tools/Kanban/Kanban.php index de461a6c25..f74ba077e8 100644 --- a/application/Espo/Tools/Kanban/Kanban.php +++ b/application/Espo/Tools/Kanban/Kanban.php @@ -246,7 +246,7 @@ class Kanban $repository->clone($query)->count() : ($hasMore ? Collection::TOTAL_HAS_MORE : Collection::TOTAL_HAS_NO_MORE); - return new Result($collection, $total, $groupList); + return new Result($groupList, $total); } /** diff --git a/application/Espo/Tools/Kanban/Result.php b/application/Espo/Tools/Kanban/Result.php index ef18b6757c..af1d91e8b0 100644 --- a/application/Espo/Tools/Kanban/Result.php +++ b/application/Espo/Tools/Kanban/Result.php @@ -29,39 +29,26 @@ namespace Espo\Tools\Kanban; -use Espo\ORM\Entity; -use Espo\ORM\EntityCollection; - class Result { /** - * @param EntityCollection $collection - * @param GroupItem[] $groupList, + * @param GroupItem[] $groups, */ public function __construct( - private EntityCollection $collection, + private array $groups, private int $total, - private array $groupList ) {} /** - * @return EntityCollection + * @return GroupItem[] */ - public function getCollection(): EntityCollection + public function getGroups(): array { - return $this->collection; + return $this->groups; } public function getTotal(): int { return $this->total; } - - /** - * @return GroupItem[] - */ - public function getGroupList(): array - { - return $this->groupList; - } }