1 | <?php |
||
7 | class Prop |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $name; |
||
13 | |||
14 | /** |
||
15 | * @var string|null |
||
16 | */ |
||
17 | protected $hint; |
||
18 | |||
19 | /** |
||
20 | * @var bool|null |
||
21 | */ |
||
22 | protected $nullable; |
||
23 | |||
24 | /** |
||
25 | * @var null|string |
||
26 | */ |
||
27 | protected $mappedBy; |
||
28 | |||
29 | /** |
||
30 | * @var null|string |
||
31 | */ |
||
32 | protected $mappedType; |
||
33 | |||
34 | const REMOTE_ONE = 'one'; |
||
35 | const REMOTE_MANY = 'many'; |
||
36 | |||
37 | /** |
||
38 | * @var string[] |
||
39 | */ |
||
40 | protected $accessorPrefixes = array(); |
||
41 | |||
42 | /** |
||
43 | * @param $name |
||
44 | * @param string|null $hint |
||
45 | * @param bool|null $nullable |
||
46 | * @param string|null $mappedBy |
||
47 | * @param string|null $mappedType |
||
48 | */ |
||
49 | public function __construct($name, $hint = null, $nullable = null, $mappedBy = null, $mappedType = null) |
||
57 | |||
58 | /** |
||
59 | * @return string |
||
60 | */ |
||
61 | public function getName() |
||
65 | |||
66 | /** |
||
67 | * @return null|string |
||
68 | */ |
||
69 | public function getHint() |
||
73 | |||
74 | /** |
||
75 | * @return bool|null |
||
76 | */ |
||
77 | public function getNullable() |
||
81 | |||
82 | /** |
||
83 | * @return null|string |
||
84 | */ |
||
85 | public function getMappedBy() |
||
89 | |||
90 | /** |
||
91 | * @return null|string |
||
92 | */ |
||
93 | public function getMappedType() |
||
97 | |||
98 | /** |
||
99 | * @param string $accessorPrefix |
||
100 | * @return self |
||
101 | */ |
||
102 | public function method($accessorPrefix) |
||
110 | |||
111 | /** |
||
112 | * @param string $accessorPrefix |
||
113 | * @return bool |
||
114 | */ |
||
115 | public function hasMethod($accessorPrefix) |
||
119 | |||
120 | /** |
||
121 | * @param string $namespace |
||
122 | * @return string |
||
123 | */ |
||
124 | public function generatePhpDoc($namespace) |
||
134 | |||
135 | /** |
||
136 | * @param string $namespace |
||
137 | * @return string |
||
138 | */ |
||
139 | public function getPhpDocHint($namespace) |
||
149 | |||
150 | /** |
||
151 | * @param string $hint |
||
152 | * @param string $namespace |
||
153 | * @return string |
||
154 | */ |
||
155 | protected function reduceHint($hint, $namespace) |
||
165 | } |
||
166 |