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:
Julio Cesar Laura Avendaño
2019-06-10 11:36:01 -04:00
committed by Paula Quispe
parent 2174536180
commit 91e75dd29b
6 changed files with 761 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
<?php
namespace ProcessMaker\BusinessModel\Cases;
class Draft extends AbstractCases
{
}

View File

@@ -0,0 +1,8 @@
<?php
namespace ProcessMaker\BusinessModel\Cases;
class Inbox extends AbstractCases
{
}

View File

@@ -0,0 +1,8 @@
<?php
namespace ProcessMaker\BusinessModel\Cases;
class Participated extends AbstractCases
{
}

View File

@@ -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;
}
}

View File

@@ -0,0 +1,10 @@
<?php
namespace ProcessMaker\BusinessModel\Interfaces;
interface CasesInterface
{
public function setProperties(array $properties);
public function getData();
public function getCounter();
}