Total Complexity | 2 |
Total Lines | 14 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | final readonly class Index implements ComponentInterface |
||
|
|||
31 | { |
||
32 | /** |
||
33 | * @param array<array-key,string> $columns |
||
34 | */ |
||
35 | public function __construct(private readonly array $columns) |
||
36 | { |
||
37 | } |
||
38 | |||
39 | public function toDBAL(string $table): DBALIndex |
||
40 | { |
||
41 | return new DBALIndex( |
||
42 | name: DB::prefix(implode('_', ['ix', $table, ...$this->columns])), |
||
43 | columns: $this->columns, |
||
44 | ); |
||
47 |