cycle /
annotated
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace Cycle\Annotated\Annotation; |
||
| 6 | |||
| 7 | use Doctrine\Common\Annotations\Annotation\Target; |
||
| 8 | use Spiral\Attributes\NamedArgumentConstructor; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * @Annotation |
||
| 12 | * @NamedArgumentConstructor |
||
| 13 | * @Target("CLASS") |
||
| 14 | */ |
||
| 15 | #[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor] |
||
| 16 | final class Embeddable |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @param non-empty-string|null $role Entity role. Defaults to the lowercase class name without a namespace. |
||
|
0 ignored issues
–
show
Documentation
Bug
introduced
by
Loading history...
|
|||
| 20 | * @param class-string|null $mapper Mapper class name. Defaults to {@see \Cycle\ORM\Mapper\Mapper}. |
||
| 21 | * @param string $columnPrefix Custom prefix for embeddable entity columns. |
||
| 22 | * @param Column[] $columns Embedded entity columns. |
||
| 23 | */ |
||
| 24 | 72 | public function __construct( |
|
| 25 | private ?string $role = null, |
||
| 26 | private ?string $mapper = null, |
||
| 27 | private string $columnPrefix = '', |
||
| 28 | private array $columns = [], |
||
| 29 | ) { |
||
| 30 | 72 | } |
|
| 31 | |||
| 32 | 72 | public function getRole(): ?string |
|
| 33 | { |
||
| 34 | 72 | return $this->role; |
|
| 35 | } |
||
| 36 | |||
| 37 | 72 | public function getMapper(): ?string |
|
| 38 | { |
||
| 39 | 72 | return $this->mapper; |
|
| 40 | } |
||
| 41 | |||
| 42 | 72 | public function getColumnPrefix(): string |
|
| 43 | { |
||
| 44 | 72 | return $this->columnPrefix; |
|
| 45 | } |
||
| 46 | |||
| 47 | public function getColumns(): array |
||
| 48 | { |
||
| 49 | return $this->columns; |
||
| 50 | } |
||
| 51 | } |
||
| 52 |