REFACTORING #1880 @4h30m: another ugly refactoring commit

This commit is contained in:
Michal Kváček
2016-10-25 16:50:04 +02:00
parent 28f67ffe3c
commit cc999dd24e
71 changed files with 827 additions and 608 deletions
@@ -96,18 +96,18 @@ class ArticleList extends Handler
*/
public function render(Content $content, $parameters)
{
$articles = ArticleModel::where('module_handler', Article::class)
$articles = ArticleModel::where('moduleHandler', Article::class)
->with('comments')
->with('category')
->where(function ($query) {
$query->where('published_from', '<', Carbon::now())
->orWhereNull('published_from');
$query->where('publishedFrom', '<', Carbon::now())
->orWhereNull('publishedFrom');
})
->where(function ($query) {
$query->where('published_to', '>', Carbon::now())
->orWhereNull('published_to');
$query->where('publishedTo', '>', Carbon::now())
->orWhereNull('publishedTo');
})
->orderBy('published_from', 'DESC')
->orderBy('publishedFrom', 'DESC')
->orderBy('created_at', 'DESC');
// show articles for not-logged users of even for logged onew?
@@ -135,7 +135,7 @@ class ArticleList extends Handler
// decode module settings
foreach ($articles as $article) {
$article->module_settings = json_decode($article->module_settings);
$article->moduleSettings = json_decode($article->moduleSettings);
}
return Controller::VisitorsView($content->template, [