Extended
2 days ago
ExtendedValueLink.php
2 days ago
ExtendedValueLinkFactory.php
2 days ago
ExtendedValueRegistry.php
2 days ago
ExtendedValueLinkFactory.php
33 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Value; |
| 6 | |
| 7 | final class ExtendedValueLinkFactory |
| 8 | { |
| 9 | private array $attributes; |
| 10 | |
| 11 | private array $params; |
| 12 | |
| 13 | public function __construct( |
| 14 | array $attributes = [], |
| 15 | array $params = [] |
| 16 | ) { |
| 17 | $this->attributes = $attributes; |
| 18 | $this->params = $params; |
| 19 | } |
| 20 | |
| 21 | public function create(string $label, int $id): ExtendedValueLink |
| 22 | { |
| 23 | return new ExtendedValueLink( |
| 24 | $label, |
| 25 | $id, |
| 26 | 'value', |
| 27 | $this->attributes, |
| 28 | $this->params |
| 29 | ); |
| 30 | } |
| 31 | |
| 32 | } |
| 33 |