2013-09-04 16:11:33 -04:00
|
|
|
<?php
|
2013-12-03 17:10:18 -04:00
|
|
|
namespace ProcessMaker\Services;
|
2013-09-04 16:11:33 -04:00
|
|
|
|
2013-12-05 20:41:21 -04:00
|
|
|
/**
|
|
|
|
|
* Abstract Class Api
|
|
|
|
|
*
|
|
|
|
|
* Api class be be extended by Restler Classes
|
|
|
|
|
*
|
|
|
|
|
* @package ProcessMaker\Services
|
|
|
|
|
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
|
|
|
|
*/
|
|
|
|
|
abstract class Api
|
2013-09-04 16:11:33 -04:00
|
|
|
{
|
|
|
|
|
private static $workspace;
|
2013-10-09 13:16:05 -04:00
|
|
|
private static $userId;
|
2013-09-04 16:11:33 -04:00
|
|
|
|
2013-12-02 12:56:13 -04:00
|
|
|
const STAT_CREATED = 201;
|
|
|
|
|
const STAT_APP_EXCEPTION = 400;
|
2013-11-07 12:37:16 -04:00
|
|
|
|
2013-09-04 16:11:33 -04:00
|
|
|
public function __costruct()
|
|
|
|
|
{
|
2013-09-05 10:04:02 -04:00
|
|
|
self::$workspace = null;
|
2013-09-04 16:11:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function setWorkspace($workspace)
|
|
|
|
|
{
|
|
|
|
|
self::$workspace = $workspace;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getWorkspace()
|
|
|
|
|
{
|
|
|
|
|
return self::$workspace;
|
|
|
|
|
}
|
2013-10-09 13:16:05 -04:00
|
|
|
|
|
|
|
|
public static function setUserId($userId)
|
|
|
|
|
{
|
|
|
|
|
self::$userId = $userId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getUserId()
|
|
|
|
|
{
|
2014-04-02 16:51:28 -04:00
|
|
|
return \ProcessMaker\Services\OAuth2\Server::getUserId();
|
2013-10-09 13:16:05 -04:00
|
|
|
}
|
2014-01-27 17:35:58 -04:00
|
|
|
}
|
|
|
|
|
|