* [ADD] Include custom field in API response. Thanks to @sf32738 for the feedback. Closes #1388.

Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
Rubén D
2020-01-11 20:50:09 +01:00
parent 496a3e95f4
commit 3bcf2e0b4d
34 changed files with 409 additions and 50 deletions

View File

@@ -29,7 +29,10 @@ use DI\DependencyException;
use DI\NotFoundException;
use Exception;
use Klein\Klein;
use League\Fractal\Manager;
use Psr\Container\ContainerInterface;
use SP\Config\ConfigData;
use SP\Core\Acl\Acl;
use SP\Core\Context\StatelessContext;
use SP\Core\Events\EventDispatcher;
use SP\Core\Exceptions\SPException;
@@ -75,6 +78,18 @@ abstract class ControllerBase
* @var Klein
*/
protected $router;
/**
* @var ConfigData
*/
protected $configData;
/**
* @var Manager
*/
protected $fractal;
/**
* @var Acl
*/
protected $acl;
/**
* @var bool
*/
@@ -93,9 +108,12 @@ abstract class ControllerBase
{
$this->dic = $container;
$this->context = $container->get(StatelessContext::class);
$this->configData = $container->get(ConfigData::class);
$this->eventDispatcher = $container->get(EventDispatcher::class);
$this->router = $container->get(Klein::class);
$this->apiService = $container->get(ApiService::class);
$this->acl = $container->get(Acl::class);
$this->fractal = new Manager();
$this->controllerName = $this->getControllerName();
$this->actionName = $actionName;