PMCORE-1213

This commit is contained in:
Paula Quispe
2020-11-11 10:38:08 -04:00
parent 50b5eaec39
commit 4120a8ca9f
21 changed files with 888 additions and 431 deletions

View File

@@ -0,0 +1,62 @@
<?php
namespace ProcessMaker\BusinessModel\Cases;
class MyCases extends AbstractCases
{
/**
* Gets the data for the Cases list My Cases
*
* @return array
*/
public function getData()
{
$filter = $this->getParticipatedStatus();
$result = [];
if (!empty($filter)) {
switch ($filter) {
case 'STARTED':
case 'IN_PROGRESS':
case 'COMPLETED':
$list = new Participated();
$result = $list->getData();
break;
case 'SUPERVISING':
// Scope that search for the SUPERVISING cases by specific user
$list = new Supervising();
$result = $list->getData();
break;
}
}
return $result;
}
/**
* Gets the total of My Cases
*
* @return int
*/
public function getCounter()
{
$filter = $this->getParticipatedStatus();
$count = 0;
if (!empty($filter)) {
switch ($filter) {
case 'STARTED':
case 'IN_PROGRESS':
case 'COMPLETED':
$list = new Participated();
$count = $list->getCounter();
break;
case 'SUPERVISING':
// Scope that search for the SUPERVISING cases by specific user
$list = new Supervising();
$count = $list->getCounter();
break;
}
}
return $count;
}
}