PMCORE-3222 Service - Get custom case list schema and data
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user