Skip to content

Commit 46d0552

Browse files
committed
Migrate to new dravencms/locale
1 parent acd2edf commit 46d0552

File tree

2 files changed

+16
-8
lines changed
  • src/Dravencms

2 files changed

+16
-8
lines changed

src/Dravencms/AdminModule/Components/Article/ArticleGrid/ArticleGrid.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
use Dravencms\Components\BaseControl\BaseControl;
2525
use Dravencms\Components\BaseGrid\BaseGridFactory;
26-
use Dravencms\Locale\CurrentLocale;
26+
use Dravencms\Locale\CurrentLocaleResolver;
2727
use Dravencms\Model\Article\Entities\Group;
2828
use Dravencms\Model\Article\Repository\ArticleRepository;
2929
use Dravencms\Model\Locale\Repository\LocaleRepository;
@@ -46,6 +46,7 @@ class ArticleGrid extends BaseControl
4646
/** @var EntityManager */
4747
private $entityManager;
4848

49+
/** @var ILocale */
4950
private $currentLocale;
5051

5152
/** @var Group */
@@ -62,22 +63,22 @@ class ArticleGrid extends BaseControl
6263
* @param ArticleRepository $articleRepository
6364
* @param BaseGridFactory $baseGridFactory
6465
* @param EntityManager $entityManager
65-
* @param CurrentLocale $currentLocale
66+
* @param CurrentLocaleResolver $currentLocaleResolver
6667
*/
6768
public function __construct(
6869
Group $group,
6970
ArticleRepository $articleRepository,
7071
BaseGridFactory $baseGridFactory,
7172
EntityManager $entityManager,
72-
CurrentLocale $currentLocale
73+
CurrentLocaleResolver $currentLocaleResolver
7374
)
7475
{
7576
parent::__construct();
7677

7778
$this->group = $group;
7879
$this->baseGridFactory = $baseGridFactory;
7980
$this->articleRepository = $articleRepository;
80-
$this->currentLocale = $currentLocale;
81+
$this->currentLocale = $currentLocaleResolver->getCurrentLocale();
8182
$this->entityManager = $entityManager;
8283
}
8384

src/Dravencms/FrontModule/Components/Article/Article/Detail/Detail.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Dravencms\FrontModule\Components\Article\Article\Detail;
44

55
use Dravencms\Components\BaseControl\BaseControl;
6-
use Dravencms\Locale\CurrentLocale;
6+
use Dravencms\Locale\CurrentLocaleResolver;
77
use Dravencms\Model\Article\Repository\ArticleRepository;
88
use Dravencms\Model\Article\Repository\ArticleTranslationRepository;
99
use Salamek\Cms\ICmsActionOption;
@@ -16,24 +16,31 @@ class Detail extends BaseControl
1616
/** @var ICmsActionOption */
1717
private $cmsActionOption;
1818

19-
/** @var CurrentLocale */
19+
/** @var ILocale */
2020
private $currentLocale;
2121

2222
/** @var ArticleTranslationRepository */
2323
private $articleTranslationRepository;
2424

25+
/**
26+
* Detail constructor.
27+
* @param ICmsActionOption $cmsActionOption
28+
* @param ArticleRepository $articleRepository
29+
* @param ArticleTranslationRepository $articleTranslationRepository
30+
* @param CurrentLocaleResolver $currentLocaleResolver
31+
*/
2532
public function __construct(
2633
ICmsActionOption $cmsActionOption,
2734
ArticleRepository $articleRepository,
2835
ArticleTranslationRepository $articleTranslationRepository,
29-
CurrentLocale $currentLocale
36+
CurrentLocaleResolver $currentLocaleResolver
3037
)
3138
{
3239
parent::__construct();
3340
$this->cmsActionOption = $cmsActionOption;
3441
$this->articleRepository = $articleRepository;
3542
$this->articleTranslationRepository = $articleTranslationRepository;
36-
$this->currentLocale = $currentLocale;
43+
$this->currentLocale = $currentLocaleResolver->getCurrentLocale();
3744
}
3845

3946
public function render()

0 commit comments

Comments
 (0)