Generic
2 days ago
Options
2 days ago
ArrayMapper.php
2 days ago
Option.php
2 days ago
OptionGroup.php
2 days ago
Options.php
2 days ago
Paginated.php
2 days ago
Response.php
2 days ago
Response.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Helper\Select; |
| 6 | |
| 7 | final class Response |
| 8 | { |
| 9 | private Options $options; |
| 10 | |
| 11 | private bool $more; |
| 12 | |
| 13 | public function __construct(Options $options, bool $more = false) |
| 14 | { |
| 15 | $this->options = $options; |
| 16 | $this->more = $more; |
| 17 | } |
| 18 | |
| 19 | public function __invoke(): array |
| 20 | { |
| 21 | return [ |
| 22 | 'results' => ArrayMapper::map($this->options), |
| 23 | 'pagination' => [ |
| 24 | 'more' => $this->more, |
| 25 | ], |
| 26 | ]; |
| 27 | } |
| 28 | |
| 29 | } |
| 30 |