continue with getter/setter removal

This commit is contained in:
Dennis Eichhorn 2023-05-30 04:15:36 +02:00
parent 2ea7a004d6
commit fe4ad79ba2
2 changed files with 16 additions and 16 deletions

View File

@ -90,7 +90,7 @@ final class ApiController extends Controller
$response, $response,
NotificationLevel::OK, NotificationLevel::OK,
'', '',
$this->app->l11nManager->getText($response->getLanguage(), '0', '0', 'SucessfulCreate'), $this->app->l11nManager->getText($response->header->l11n->language, '0', '0', 'SucessfulCreate'),
$vehicle $vehicle
); );
} }
@ -175,7 +175,7 @@ final class ApiController extends Controller
$typeL11n = new BaseStringL11n(); $typeL11n = new BaseStringL11n();
$typeL11n->ref = $request->getDataInt('type') ?? 0; $typeL11n->ref = $request->getDataInt('type') ?? 0;
$typeL11n->setLanguage( $typeL11n->setLanguage(
$request->getDataString('language') ?? $request->getLanguage() $request->getDataString('language') ?? $request->header->l11n->language
); );
$typeL11n->content = $request->getDataString('title') ?? ''; $typeL11n->content = $request->getDataString('title') ?? '';
@ -234,7 +234,7 @@ final class ApiController extends Controller
$response, $response,
NotificationLevel::OK, NotificationLevel::OK,
'', '',
$this->app->l11nManager->getText($response->getLanguage(), '0', '0', 'SucessfulCreate'), $this->app->l11nManager->getText($response->header->l11n->language, '0', '0', 'SucessfulCreate'),
$vehicle $vehicle
); );
} }
@ -319,7 +319,7 @@ final class ApiController extends Controller
$typeL11n = new BaseStringL11n(); $typeL11n = new BaseStringL11n();
$typeL11n->ref = $request->getDataInt('type') ?? 0; $typeL11n->ref = $request->getDataInt('type') ?? 0;
$typeL11n->setLanguage( $typeL11n->setLanguage(
$request->getDataString('language') ?? $request->getLanguage() $request->getDataString('language') ?? $request->header->l11n->language
); );
$typeL11n->content = $request->getDataString('title') ?? ''; $typeL11n->content = $request->getDataString('title') ?? '';
@ -384,7 +384,7 @@ final class ApiController extends Controller
$response, $response,
NotificationLevel::OK, NotificationLevel::OK,
'', '',
$this->app->l11nManager->getText($response->getLanguage(), '0', '0', 'SucessfulCreate'), $this->app->l11nManager->getText($response->header->l11n->language, '0', '0', 'SucessfulCreate'),
$vehicle $vehicle
); );
} }
@ -755,7 +755,7 @@ final class ApiController extends Controller
$attrL11n = new BaseStringL11n(); $attrL11n = new BaseStringL11n();
$attrL11n->ref = $request->getDataInt('type') ?? 0; $attrL11n->ref = $request->getDataInt('type') ?? 0;
$attrL11n->setLanguage( $attrL11n->setLanguage(
$request->getDataString('language') ?? $request->getLanguage() $request->getDataString('language') ?? $request->header->l11n->language
); );
$attrL11n->content = $request->getDataString('title') ?? ''; $attrL11n->content = $request->getDataString('title') ?? '';
@ -980,7 +980,7 @@ final class ApiController extends Controller
$attrL11n = new BaseStringL11n(); $attrL11n = new BaseStringL11n();
$attrL11n->ref = $request->getDataInt('value') ?? 0; $attrL11n->ref = $request->getDataInt('value') ?? 0;
$attrL11n->setLanguage( $attrL11n->setLanguage(
$request->getDataString('language') ?? $request->getLanguage() $request->getDataString('language') ?? $request->header->l11n->language
); );
$attrL11n->content = $request->getDataString('title') ?? ''; $attrL11n->content = $request->getDataString('title') ?? '';
@ -1211,7 +1211,7 @@ final class ApiController extends Controller
$response, $response,
NotificationLevel::OK, NotificationLevel::OK,
'', '',
$this->app->l11nManager->getText($response->getLanguage(), '0', '0', 'SucessfulCreate'), $this->app->l11nManager->getText($response->header->l11n->language, '0', '0', 'SucessfulCreate'),
$vehicle $vehicle
); );
} }
@ -1296,7 +1296,7 @@ final class ApiController extends Controller
$typeL11n = new BaseStringL11n(); $typeL11n = new BaseStringL11n();
$typeL11n->ref = $request->getDataInt('type') ?? 0; $typeL11n->ref = $request->getDataInt('type') ?? 0;
$typeL11n->setLanguage( $typeL11n->setLanguage(
$request->getDataString('language') ?? $request->getLanguage() $request->getDataString('language') ?? $request->header->l11n->language
); );
$typeL11n->content = $request->getDataString('title') ?? ''; $typeL11n->content = $request->getDataString('title') ?? '';

View File

@ -58,7 +58,7 @@ final class BackendController extends Controller
/** @var \Modules\Attribute\Models\AttributeType[] $attributes */ /** @var \Modules\Attribute\Models\AttributeType[] $attributes */
$attributes = VehicleAttributeTypeMapper::getAll() $attributes = VehicleAttributeTypeMapper::getAll()
->with('l11n') ->with('l11n')
->where('l11n/language', $response->getLanguage()) ->where('l11n/language', $response->header->l11n->language)
->execute(); ->execute();
$view->addData('attributes', $attributes); $view->addData('attributes', $attributes);
@ -88,7 +88,7 @@ final class BackendController extends Controller
$list = VehicleMapper::getAll() $list = VehicleMapper::getAll()
->with('type') ->with('type')
->with('type/l11n') ->with('type/l11n')
->where('type/l11n/language', $response->getLanguage()) ->where('type/l11n/language', $response->header->l11n->language)
->sort('id', 'DESC') ->sort('id', 'DESC')
->execute(); ->execute();
@ -119,7 +119,7 @@ final class BackendController extends Controller
$attribute = VehicleAttributeTypeMapper::get() $attribute = VehicleAttributeTypeMapper::get()
->with('l11n') ->with('l11n')
->where('id', (int) $request->getData('id')) ->where('id', (int) $request->getData('id'))
->where('l11n/language', $response->getLanguage()) ->where('l11n/language', $response->header->l11n->language)
->execute(); ->execute();
$l11ns = VehicleAttributeTypeL11nMapper::getAll() $l11ns = VehicleAttributeTypeL11nMapper::getAll()
@ -161,9 +161,9 @@ final class BackendController extends Controller
->with('fuelType') ->with('fuelType')
->with('fuelType/l11n') ->with('fuelType/l11n')
->where('id', (int) $request->getData('id')) ->where('id', (int) $request->getData('id'))
->where('type/l11n/language', $response->getLanguage()) ->where('type/l11n/language', $response->header->l11n->language)
->where('fuelType/l11n/language', $response->getLanguage()) ->where('fuelType/l11n/language', $response->header->l11n->language)
->where('attributes/type/l11n/language', $response->getLanguage()) ->where('attributes/type/l11n/language', $response->header->l11n->language)
->execute(); ->execute();
$view->setData('vehicle', $vehicle); $view->setData('vehicle', $vehicle);
@ -192,7 +192,7 @@ final class BackendController extends Controller
$vehicleTypes = VehicleTypeMapper::getAll() $vehicleTypes = VehicleTypeMapper::getAll()
->with('l11n') ->with('l11n')
->where('l11n/language', $response->getLanguage()) ->where('l11n/language', $response->header->l11n->language)
->execute(); ->execute();
$view->addData('types', $vehicleTypes); $view->addData('types', $vehicleTypes);