continue with getter/setter removal

This commit is contained in:
Dennis Eichhorn 2023-05-30 04:15:41 +02:00
parent 1133d23738
commit ee84056dd9
3 changed files with 8 additions and 8 deletions

View File

@ -123,7 +123,7 @@ final class ApiController extends Controller
}
$tag = $this->createTagFromRequest($request);
$tag->setL11n($request->getDataString('title') ?? '', $request->getDataString('language') ?? $request->getLanguage());
$tag->setL11n($request->getDataString('title') ?? '', $request->getDataString('language') ?? $request->header->l11n->language);
$this->createModel($request->header->account, $tag, TagMapper::class, 'tag', $request->getOrigin());
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Tag', 'Tag successfully created', $tag);
@ -210,7 +210,7 @@ final class ApiController extends Controller
$tagL11n = new BaseStringL11n();
$tagL11n->ref = $request->getDataInt('tag') ?? 0;
$tagL11n->setLanguage(
$request->getDataString('language') ?? $request->getLanguage()
$request->getDataString('language') ?? $request->header->l11n->language
);
$tagL11n->content = $request->getDataString('title') ?? '';
@ -276,7 +276,7 @@ final class ApiController extends Controller
/** @var \Modules\Tag\Models\Tag[] $tags */
$tags = TagMapper::getAll()
->with('title')
->where('title/language', $request->getLanguage())
->where('title/language', $request->header->l11n->language)
->where('title/content', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE')
->execute();

View File

@ -78,7 +78,7 @@ final class BackendController extends Controller
TagMapper::getAll()
->with('title')
->where('id', $request->getDataInt('id') ?? 0, '<')
->where('title/language', $request->getLanguage())
->where('title/language', $request->header->l11n->language)
->limit(25)
->execute()
);
@ -87,7 +87,7 @@ final class BackendController extends Controller
TagMapper::getAll()
->with('title')
->where('id', $request->getDataInt('id') ?? 0, '>')
->where('title/language', $request->getLanguage())
->where('title/language', $request->header->l11n->language)
->limit(25)
->execute()
);
@ -96,7 +96,7 @@ final class BackendController extends Controller
TagMapper::getAll()
->with('title')
->where('id', 0, '>')
->where('title/language', $request->getLanguage())
->where('title/language', $request->header->l11n->language)
->limit(25)
->execute()
);
@ -125,7 +125,7 @@ final class BackendController extends Controller
$tag = TagMapper::get()
->with('title')
->where('id', (int) $request->getData('id'))
->where('title/language', $response->getLanguage())
->where('title/language', $response->header->l11n->language)
->execute();
$view->setTemplate('/Modules/Tag/Theme/Backend/tag-single');

View File

@ -51,6 +51,6 @@ final class TagL11nMapperTest extends \PHPUnit\Framework\TestCase
$l11nR = TagL11nMapper::get()->where('id', $l11n->id)->execute();
self::assertEquals($l11n->content, $l11nR->content);
self::assertEquals($l11n->getLanguage(), $l11nR->getLanguage());
self::assertEquals($l11n->language, $l11nR->getLanguage());
}
}