1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Cycle\Annotated\Annotation\Table; |
||
6 | |||
7 | use Doctrine\Common\Annotations\Annotation\Target; |
||
8 | use Spiral\Attributes\NamedArgumentConstructor; |
||
9 | |||
10 | /** |
||
11 | * @Annotation |
||
12 | * @NamedArgumentConstructor |
||
13 | * @Target("ANNOTATION", "CLASS") |
||
14 | */ |
||
15 | #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE), NamedArgumentConstructor] |
||
16 | class Index |
||
17 | { |
||
18 | /** |
||
19 | * @param non-empty-string[] $columns |
||
0 ignored issues
–
show
Documentation
Bug
introduced
by
![]() |
|||
20 | * @param non-empty-string|null $name |
||
21 | */ |
||
22 | 680 | public function __construct( |
|
23 | private array $columns, |
||
24 | private bool $unique = false, |
||
25 | private ?string $name = null, |
||
26 | ) { |
||
27 | 680 | } |
|
28 | |||
29 | 502 | public function getColumns(): array |
|
30 | { |
||
31 | 502 | return $this->columns; |
|
32 | } |
||
33 | |||
34 | 478 | public function getIndex(): ?string |
|
35 | { |
||
36 | 478 | return $this->name; |
|
37 | } |
||
38 | |||
39 | 478 | public function isUnique(): bool |
|
40 | { |
||
41 | 478 | return $this->unique; |
|
42 | } |
||
43 | } |
||
44 |