Skip to content

Commit dca77fd

Browse files
committed
New Yesno options model
1 parent aa92de7 commit dca77fd

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

ViewModel/Options/YesNoOptions.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
namespace Loki\AdminComponents\ViewModel\Options;
5+
6+
use Magento\Framework\View\Element\Block\ArgumentInterface;
7+
use Magento\Framework\Data\OptionSourceInterface;
8+
9+
class YesNoOptions implements ArgumentInterface, OptionSourceInterface
10+
{
11+
public function toOptionArray(): array
12+
{
13+
$options = [];
14+
15+
16+
$options[] = [
17+
'label' => __('Yes'),
18+
'value' => 1,
19+
];
20+
21+
22+
$options[] = [
23+
'label' => __('No'),
24+
'value' => 0,
25+
];
26+
27+
return $options;
28+
}
29+
}

0 commit comments

Comments
 (0)