kanban ref
This commit is contained in:
@@ -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()),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user