Passed
Push — master ( 874ec8...d3e627 )
by Anton
02:46 queued 52s
created

Entity::isReadonlySchema()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php declare(strict_types=1);
2
/**
3
 * Spiral Framework.
4
 *
5
 * @license   MIT
6
 * @author    Anton Titov (Wolfy-J)
7
 */
8
9
namespace Cycle\Annotated\Annotation;
10
11
use Spiral\Annotations\AbstractAnnotation;
12
use Spiral\Annotations\Parser;
13
14
final class Entity extends AbstractAnnotation
15
{
16
    public const NAME   = 'entity';
17
    public const SCHEMA = [
18
        'role'           => Parser::STRING,
19
        'mapper'         => Parser::STRING,
20
        'repository'     => Parser::STRING,
21
        'table'          => Parser::STRING,
22
        'database'       => Parser::STRING,
23
        'readonlySchema' => Parser::BOOL,
24
        'source'         => Parser::STRING,
25
        'constrain'      => Parser::STRING
26
    ];
27
28
    /** @var string|null */
29
    protected $role;
30
31
    /** @var string|null */
32
    protected $mapper;
33
34
    /** @var string|null */
35
    protected $repository;
36
37
    /** @var string|null */
38
    protected $table;
39
40
    /** @var bool */
41
    protected $readonlySchema = false;
42
43
    /** @var string|null */
44
    protected $database;
45
46
    /** @var string|null */
47
    protected $source;
48
49
    /** @var string|null */
50
    protected $constrain;
51
52
    /**
53
     * @return string|null
54
     */
55
    public function getRole(): ?string
56
    {
57
        return $this->role;
58
    }
59
60
    /**
61
     * @return string|null
62
     */
63
    public function getMapper(): ?string
64
    {
65
        return $this->mapper;
66
    }
67
68
    /**
69
     * @return string|null
70
     */
71
    public function getRepository(): ?string
72
    {
73
        return $this->repository;
74
    }
75
76
    /**
77
     * @return string|null
78
     */
79
    public function getTable(): ?string
80
    {
81
        return $this->table;
82
    }
83
84
    /**
85
     * @return bool
86
     */
87
    public function isReadonlySchema(): bool
88
    {
89
        return $this->readonlySchema;
90
    }
91
92
    /**
93
     * @return string|null
94
     */
95
    public function getDatabase(): ?string
96
    {
97
        return $this->database;
98
    }
99
100
    /**
101
     * @return string|null
102
     */
103
    public function getSource(): ?string
104
    {
105
        return $this->source;
106
    }
107
108
    /**
109
     * @return string|null
110
     */
111
    public function getConstrain(): ?string
112
    {
113
        return $this->constrain;
114
    }
115
}