Continue with getter/setter cleanup

This commit is contained in:
Dennis Eichhorn 2023-05-30 15:44:18 +02:00
parent fe4ad79ba2
commit cb44e3ac3a
6 changed files with 21 additions and 21 deletions

View File

@ -53,7 +53,7 @@ final class BackendController extends Controller
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/attribute-type-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1003503001, $request, $response));
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003503001, $request, $response);
/** @var \Modules\Attribute\Models\AttributeType[] $attributes */
$attributes = VehicleAttributeTypeMapper::getAll()
@ -61,7 +61,7 @@ final class BackendController extends Controller
->where('l11n/language', $response->header->l11n->language)
->execute();
$view->addData('attributes', $attributes);
$view->data['attributes'] = $attributes;
return $view;
}
@ -83,7 +83,7 @@ final class BackendController extends Controller
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/vehicle-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1003502001, $request, $response));
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003502001, $request, $response);
$list = VehicleMapper::getAll()
->with('type')
@ -92,7 +92,7 @@ final class BackendController extends Controller
->sort('id', 'DESC')
->execute();
$view->setData('vehicles', $list);
$view->data['vehicles'] = $list;
return $view;
}
@ -113,7 +113,7 @@ final class BackendController extends Controller
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/attribute-type');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response));
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response);
/** @var \Modules\Attribute\Models\AttributeType $attribute */
$attribute = VehicleAttributeTypeMapper::get()
@ -126,8 +126,8 @@ final class BackendController extends Controller
->where('ref', $attribute->id)
->execute();
$view->addData('attribute', $attribute);
$view->addData('l11ns', $l11ns);
$view->data['attribute'] = $attribute;
$view->data['l11ns'] = $l11ns;
return $view;
}
@ -149,7 +149,7 @@ final class BackendController extends Controller
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/vehicle-profile');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1003502001, $request, $response));
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003502001, $request, $response);
$vehicle = VehicleMapper::get()
->with('attributes')
@ -166,7 +166,7 @@ final class BackendController extends Controller
->where('attributes/type/l11n/language', $response->header->l11n->language)
->execute();
$view->setData('vehicle', $vehicle);
$view->data['vehicle'] = $vehicle;
$query = new Builder($this->app->dbPool->get());
$results = $query->selectAs(VehicleMapper::HAS_MANY['files']['external'], 'file')
@ -188,14 +188,14 @@ final class BackendController extends Controller
->limit(1)
->execute();
$view->addData('vehicleImage', $vehicleImage);
$view->data['vehicleImage'] = $vehicleImage;
$vehicleTypes = VehicleTypeMapper::getAll()
->with('l11n')
->where('l11n/language', $response->header->l11n->language)
->execute();
$view->addData('types', $vehicleTypes);
$view->data['types'] = $vehicleTypes;
return $view;
}

View File

@ -15,9 +15,9 @@ declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/** @var \phpOMS\Views\View $this */
$attributes = $this->getData('attributes');
$attributes = $this->data['attributes'];
echo $this->getData('nav')->render(); ?>
echo $this->data['nav']->render(); ?>
<div class="row">
<div class="col-xs-12">

View File

@ -17,10 +17,10 @@ use phpOMS\Localization\ISO639Enum;
$types = AttributeValueType::getConstants();
$attribute = $this->getData('attribute');
$l11ns = $this->getData('l11ns');
$attribute = $this->data['attribute'];
$l11ns = $this->data['l11ns'];
echo $this->getData('nav')->render(); ?>
echo $this->data['nav']->render(); ?>
<div class="row">
<div class="col-md-6 col-xs-12">

View File

@ -15,7 +15,7 @@ declare(strict_types=1);
/**
* @var \phpOMS\Views\View $this
*/
echo $this->getData('nav')->render(); ?>
echo $this->data['nav']->render(); ?>
<div class="tabview tab-2">
<div class="box">

View File

@ -16,9 +16,9 @@ declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/** @var \phpOMS\Views\View $this */
$vehicles = $this->getData('vehicles') ?? [];
$vehicles = $this->data['vehicles'] ?? [];
echo $this->getData('nav')->render(); ?>
echo $this->data['nav']->render(); ?>
<div class="row">
<div class="col-xs-12">
<section class="portlet">

View File

@ -27,12 +27,12 @@ $vehicleStatus = VehicleStatus::getConstants();
$vehicle = $this->getData('vehicle') ?? new NullVehicle();
$files = $vehicle->files;
$vehicleImage = $this->getData('vehicleImage') ?? new NullMedia();
$vehicleTypes = $this->getData('types') ?? [];
$vehicleTypes = $this->data['types'] ?? [];
/**
* @var \phpOMS\Views\View $this
*/
echo $this->getData('nav')->render();
echo $this->data['nav']->render();
?>
<div class="tabview tab-2">
<div class="box">