PMCORE-3222 Service - Get custom case list schema and data

This commit is contained in:
Roly Gutierrez
2021-08-25 15:41:05 -04:00
parent c45f0bde07
commit 4124e59ac2
7 changed files with 1196 additions and 113 deletions

View File

@@ -84,10 +84,10 @@ class Draft extends AbstractCases
/**
* Get data self-services cases by user
*
* @param callable $callback
* @return array
*/
public function getData()
public function getData(callable $callback = null)
{
$query = Delegation::query()->select($this->getColumnsView());
// Join with process
@@ -105,6 +105,9 @@ class Draft extends AbstractCases
}
// Add pagination to the query
$query->offset($this->getOffset())->limit($this->getLimit());
if (is_callable($callback)) {
$callback($query);
}
// Get the data
$results = $query->get();
// Prepare the result