kanban ref

This commit is contained in:
Yuri Kuznetsov
2024-07-16 17:53:19 +03:00
parent 269f38e07c
commit df0c56bd9b
3 changed files with 7 additions and 21 deletions
@@ -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()),
]);
}
}
+1 -1
View File
@@ -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);
}
/**
+5 -18
View File
@@ -29,39 +29,26 @@
namespace Espo\Tools\Kanban;
use Espo\ORM\Entity;
use Espo\ORM\EntityCollection;
class Result
{
/**
* @param EntityCollection<Entity> $collection
* @param GroupItem[] $groupList,
* @param GroupItem[] $groups,
*/
public function __construct(
private EntityCollection $collection,
private array $groups,
private int $total,
private array $groupList
) {}
/**
* @return EntityCollection<Entity>
* @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;
}
}