This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace Esun\ImageManager\Model\Source;
use Esun\ImageManager\Model\ResourceModel\Category\CollectionFactory;
use Magento\Framework\Data\OptionSourceInterface;
class CategoryOptions implements OptionSourceInterface
{
public function __construct(private readonly CollectionFactory $collectionFactory)
{
}
public function toOptionArray(): array
{
$options = [];
$collection = $this->collectionFactory->create()
->setOrder('sort_order', 'ASC')
->setOrder('name', 'ASC');
foreach ($collection as $category) {
$options[] = [
'value' => (int) $category->getId(),
'label' => (string) $category->getData('name'),
];
}
return $options;
}
}
@@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace Esun\ImageManager\Model\Source;
use Magento\Framework\Data\OptionSourceInterface;
class StatusOptions implements OptionSourceInterface
{
public function toOptionArray(): array
{
return [
['value' => 1, 'label' => __('Enabled')],
['value' => 0, 'label' => __('Disabled')],
];
}
}