Embeddable::getColumnPrefix()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 1
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
The doc comment non-empty-string|null at position 0 could not be parsed: Unknown type name 'non-empty-string' at position 0 in non-empty-string|null.
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