1 | <?php |
||
14 | class ScalarBeanPropertyDescriptor extends AbstractBeanPropertyDescriptor |
||
15 | { |
||
16 | /** |
||
17 | * @var Column |
||
18 | */ |
||
19 | private $column; |
||
20 | |||
21 | /** |
||
22 | * ScalarBeanPropertyDescriptor constructor. |
||
23 | * @param Table $table |
||
24 | * @param Column $column |
||
25 | * @param NamingStrategyInterface $namingStrategy |
||
26 | */ |
||
27 | public function __construct(Table $table, Column $column, NamingStrategyInterface $namingStrategy) |
||
33 | |||
34 | /** |
||
35 | * Returns the foreign-key the column is part of, if any. null otherwise. |
||
36 | * |
||
37 | * @return ForeignKeyConstraint|null |
||
38 | */ |
||
39 | public function getForeignKey() |
||
43 | |||
44 | /** |
||
45 | * Returns the param annotation for this property (useful for constructor). |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | public function getParamAnnotation() |
||
57 | |||
58 | /** |
||
59 | * Returns the name of the class linked to this property or null if this is not a foreign key. |
||
60 | * |
||
61 | * @return null|string |
||
62 | */ |
||
63 | public function getClassName(): ?string |
||
67 | |||
68 | /** |
||
69 | * Returns the PHP type for the property (it can be a scalar like int, bool, or class names, like \DateTimeInterface, App\Bean\User....) |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | public function getPhpType(): string |
||
78 | |||
79 | /** |
||
80 | * Returns true if the property is compulsory (and therefore should be fetched in the constructor). |
||
81 | * |
||
82 | * @return bool |
||
83 | */ |
||
84 | public function isCompulsory() |
||
88 | |||
89 | private function hasUuidAnnotation(): bool |
||
100 | |||
101 | /** |
||
102 | * Returns true if the property has a default value (or if the @UUID annotation is set for the column) |
||
103 | * |
||
104 | * @return bool |
||
105 | */ |
||
106 | public function hasDefault() |
||
110 | |||
111 | /** |
||
112 | * Returns the code that assigns a value to its default value. |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | public function assignToDefaultCode() |
||
135 | |||
136 | /** |
||
137 | * Returns true if the property is the primary key. |
||
138 | * |
||
139 | * @return bool |
||
140 | */ |
||
141 | public function isPrimaryKey() |
||
145 | |||
146 | /** |
||
147 | * Returns the PHP code for getters and setters. |
||
148 | * |
||
149 | * @return string |
||
150 | */ |
||
151 | public function getGetterSetterCode() |
||
206 | |||
207 | /** |
||
208 | * Returns the part of code useful when doing json serialization. |
||
209 | * |
||
210 | * @return string |
||
211 | */ |
||
212 | public function getJsonSerializeCode() |
||
222 | |||
223 | /** |
||
224 | * Returns the column name. |
||
225 | * |
||
226 | * @return string |
||
227 | */ |
||
228 | public function getColumnName() |
||
232 | } |
||
233 |