mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-02-17 00:48:42 +00:00
continue with getter/setter removal
This commit is contained in:
parent
bc2b120c57
commit
b1457fe4ca
|
|
@ -328,7 +328,7 @@ final class ApiController extends Controller
|
||||||
$newsArticle->title = $request->getDataString('title') ?? '';
|
$newsArticle->title = $request->getDataString('title') ?? '';
|
||||||
$newsArticle->plain = $request->getDataString('plain') ?? '';
|
$newsArticle->plain = $request->getDataString('plain') ?? '';
|
||||||
$newsArticle->content = Markdown::parse($request->getDataString('plain') ?? '');
|
$newsArticle->content = Markdown::parse($request->getDataString('plain') ?? '');
|
||||||
$newsArticle->setLanguage(\strtolower($request->getDataString('lang') ?? $request->getLanguage()));
|
$newsArticle->setLanguage(\strtolower($request->getDataString('lang') ?? $request->header->l11n->language));
|
||||||
$newsArticle->setType($request->getDataInt('type') ?? NewsType::ARTICLE);
|
$newsArticle->setType($request->getDataInt('type') ?? NewsType::ARTICLE);
|
||||||
$newsArticle->setStatus($request->getDataInt('status') ?? NewsStatus::VISIBLE);
|
$newsArticle->setStatus($request->getDataInt('status') ?? NewsStatus::VISIBLE);
|
||||||
$newsArticle->isFeatured = $request->getDataBool('featured') ?? true;
|
$newsArticle->isFeatured = $request->getDataBool('featured') ?? true;
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,8 @@ final class BackendController extends Controller implements DashboardElementInte
|
||||||
->with('tags/title')
|
->with('tags/title')
|
||||||
->where('status', NewsStatus::VISIBLE)
|
->where('status', NewsStatus::VISIBLE)
|
||||||
->where('publish', new \DateTime('now'), '<=')
|
->where('publish', new \DateTime('now'), '<=')
|
||||||
->where('language', $response->getLanguage())
|
->where('language', $response->header->l11n->language)
|
||||||
->where('tags/title/language', $response->getLanguage());
|
->where('tags/title/language', $response->header->l11n->language);
|
||||||
|
|
||||||
/** @var \Modules\News\Models\NewsArticle[] $objs */
|
/** @var \Modules\News\Models\NewsArticle[] $objs */
|
||||||
$objs = [];
|
$objs = [];
|
||||||
|
|
@ -124,8 +124,8 @@ final class BackendController extends Controller implements DashboardElementInte
|
||||||
->with('tags/title')
|
->with('tags/title')
|
||||||
->where('status', NewsStatus::VISIBLE)
|
->where('status', NewsStatus::VISIBLE)
|
||||||
->where('publish', new \DateTime('now'), '<=')
|
->where('publish', new \DateTime('now'), '<=')
|
||||||
->where('language', $response->getLanguage())
|
->where('language', $response->header->l11n->language)
|
||||||
->where('tags/title/language', $response->getLanguage())
|
->where('tags/title/language', $response->header->l11n->language)
|
||||||
->where('id', 0, '>')
|
->where('id', 0, '>')
|
||||||
->limit(5)
|
->limit(5)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
@ -163,8 +163,8 @@ final class BackendController extends Controller implements DashboardElementInte
|
||||||
->with('tags/title')
|
->with('tags/title')
|
||||||
->where('status', NewsStatus::VISIBLE)
|
->where('status', NewsStatus::VISIBLE)
|
||||||
->where('publish', new \DateTime('now'), '<=')
|
->where('publish', new \DateTime('now'), '<=')
|
||||||
->where('language', $response->getLanguage())
|
->where('language', $response->header->l11n->language)
|
||||||
->where('tags/title/language', $response->getLanguage())
|
->where('tags/title/language', $response->header->l11n->language)
|
||||||
->where('id', (int) $request->getData('id'))
|
->where('id', (int) $request->getData('id'))
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
|
|
@ -240,8 +240,8 @@ final class BackendController extends Controller implements DashboardElementInte
|
||||||
->with('tags/title')
|
->with('tags/title')
|
||||||
->where('status', NewsStatus::VISIBLE)
|
->where('status', NewsStatus::VISIBLE)
|
||||||
->where('publish', new \DateTime('now'), '<=')
|
->where('publish', new \DateTime('now'), '<=')
|
||||||
->where('language', $response->getLanguage())
|
->where('language', $response->header->l11n->language)
|
||||||
->where('tags/title/language', $response->getLanguage());
|
->where('tags/title/language', $response->header->l11n->language);
|
||||||
|
|
||||||
if ($request->getData('ptype') === 'p') {
|
if ($request->getData('ptype') === 'p') {
|
||||||
$view->setData('news',
|
$view->setData('news',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user