Merged in release/3.5.0 (pull request #7389)

Release/3.5.0

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Paula Quispe
2020-07-03 18:55:56 +00:00
committed by Julio Cesar Laura Avendaño
46 changed files with 5486 additions and 396 deletions

View File

@@ -0,0 +1,51 @@
<?php
namespace ProcessMaker\Services\Api;
use Exception;
use Luracast\Restler\RestException;
use ProcessMaker\BusinessModel\TaskSchedulerBM;
use ProcessMaker\Services\Api;
/**
* TaskScheduler Controller
*
* @protected
*/
class Scheduler extends Api
{
/**
* Returns the records of SchedulerTask by category
* @url GET
*
* @param string $category
*
* @return mixed
* @throws RestException
*/
public function doGet($category = null) {
try {
return TaskSchedulerBM::getSchedule($category);
} catch (Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* Receive the options sent from Scheduler UI
* @url POST
* @status 200
*
* @param array $request_data
*
* @return array
* @throws RestException
*
*/
public function doPost(array $request) {
try {
return TaskSchedulerBM::saveSchedule($request);
} catch (Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
}