oms-Profile/Theme/Backend/Components/AccountGroupSelector/BaseView.php

76 lines
1.7 KiB
PHP

<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\Profile\Theme\Backend\Components\AccountGroupSelector;
use phpOMS\ApplicationAbstract;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Views\View;
/**
* Component view.
*
* @package TBD
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
* @codeCoverageIgnore
*/
class BaseView extends View
{
private $id = '';
private $name = '';
private $isRequired = false;
/**
* {@inheritdoc}
*/
public function __construct(ApplicationAbstract $app, RequestAbstract $request, ResponseAbstract $response)
{
parent::__construct($app, $request, $response);
$this->setTemplate('/Modules/Profile/Theme/Backend/Components/AccountGroupSelector/base');
$view = new PopupView($app, $request, $response);
$this->addData('popup', $view);
}
public function getId() : string
{
return $this->id;
}
public function getName() : string
{
return $this->name;
}
public function isRequired() : bool
{
return $this->isRequired;
}
/**
* {@inheritdoc}
*/
public function render(...$data) : string
{
$this->id = $data[0];
$this->name = $data[1];
$this->isRequired = $data[2] ?? false;
$this->getData('popup')->setId($this->id);
return parent::render();
}
}