PMCORE-1217

This commit is contained in:
Andrea Adamczyk
2020-11-04 15:40:01 -04:00
parent 9a65d236fb
commit c0f15b3db3
4 changed files with 941 additions and 23 deletions

View File

@@ -59,6 +59,9 @@ class AbstractCases implements CasesInterface
// Filter by specific cases using the case numbers
private $casesNumbers = [];
// Filter by taskId
private $taskId = '';
// Filter recent cases starting by a specific date, know as "newestthan" in the old lists classes
private $newestThan = '';
@@ -425,6 +428,26 @@ class AbstractCases implements CasesInterface
return $this->casesNumbers;
}
/**
* Set taskId value
*
* @param int $taskId
*/
public function setTaskId($taskId)
{
$this->taskId = (int) $taskId;
}
/**
* Get taskId value
*
* @return int
*/
public function getTaskId()
{
return $this->taskId;
}
/**
* Set Newest Than value
*

View File

@@ -0,0 +1,39 @@
<?php
namespace ProcessMaker\BusinessModel\Cases;
use ProcessMaker\Model\Delegation;
class Paused extends AbstractCases
{
/**
* Gets the data for the paused cases list
*
* @return array
*/
public function getData()
{
$query = Delegation::query()->select();
$query->paused($this->getUserId(), $this->getCategoryUid(), $this->getTaskId(), $this->getCaseNumber());
$query->joinPreviousIndex();
$query->joinPreviousUser();
$query->orderBy($this->getOrderByColumn(), $this->getOrderDirection());
$query->offset($this->getOffset())->limit($this->getLimit());
$result = $query->get()->values()->toArray();
return $result;
}
/**
* Get the total for the paused cases list
*
* @return int
*/
public function getCounter()
{
$total = $this->getData();
return count($total);
}
}