init
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Esun\MultiLocaleTranslation\Model\Config\Source;
|
||||
|
||||
use Esun\MultiLocaleTranslation\Model\StoreViewProvider;
|
||||
use Magento\Framework\Data\OptionSourceInterface;
|
||||
|
||||
class StoreViews implements OptionSourceInterface
|
||||
{
|
||||
public function __construct(private readonly StoreViewProvider $storeViewProvider)
|
||||
{
|
||||
}
|
||||
|
||||
public function toOptionArray(): array
|
||||
{
|
||||
$options = [['value' => 0, 'label' => __('Default Store View (0)')]];
|
||||
foreach ($this->storeViewProvider->getStoreViewOptions() as $store) {
|
||||
$options[] = [
|
||||
'value' => $store['store_id'],
|
||||
'label' => sprintf(
|
||||
'%s / %s (%s)',
|
||||
$store['label'],
|
||||
$store['website'],
|
||||
$store['code']
|
||||
),
|
||||
];
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user