PMC-858
Add new empty classes Add methos to the interface an in the abstract class, fix canceled status Added new setters/getters. Fix condition for 'oldestThan' validation. Add default value for 'orderByColumn' property Added table name in default value for order by column
This commit is contained in:
committed by
Paula Quispe
parent
2174536180
commit
91e75dd29b
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\BusinessModel\Cases;
|
||||
|
||||
class Draft extends AbstractCases
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\BusinessModel\Cases;
|
||||
|
||||
class Inbox extends AbstractCases
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\BusinessModel\Cases;
|
||||
|
||||
class Participated extends AbstractCases
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\BusinessModel\Factories;
|
||||
|
||||
use Exception;
|
||||
|
||||
class Cases
|
||||
{
|
||||
const CLASSES_NAMESPACE = "ProcessMaker\\BusinessModel\\Cases\\";
|
||||
|
||||
/**
|
||||
* Create an object an set the properties
|
||||
*
|
||||
* @param string $list
|
||||
* @param array $filters
|
||||
*
|
||||
* @return object
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function create($list, array $filters)
|
||||
{
|
||||
// Prepare the list name
|
||||
$list = capitalize($list);
|
||||
|
||||
// Build the class name
|
||||
$className = self::CLASSES_NAMESPACE . $list;
|
||||
|
||||
// Validate if the class exists
|
||||
if (class_exists($className)) {
|
||||
$instance = new $className();
|
||||
} else {
|
||||
throw new Exception("Class '{$list}' not exists.");
|
||||
}
|
||||
|
||||
// Set properties
|
||||
$instance->setProperties($filters);
|
||||
|
||||
return $instance;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\BusinessModel\Interfaces;
|
||||
|
||||
interface CasesInterface
|
||||
{
|
||||
public function setProperties(array $properties);
|
||||
public function getData();
|
||||
public function getCounter();
|
||||
}
|
||||
Reference in New Issue
Block a user