1 | <?php |
||
13 | class ObjectBeanPropertyDescriptor extends AbstractBeanPropertyDescriptor |
||
14 | { |
||
15 | /** |
||
16 | * @var ForeignKeyConstraint |
||
17 | */ |
||
18 | private $foreignKey; |
||
19 | |||
20 | /** |
||
21 | * @var SchemaAnalyzer |
||
22 | */ |
||
23 | private $schemaAnalyzer; |
||
24 | |||
25 | /** |
||
26 | * ObjectBeanPropertyDescriptor constructor. |
||
27 | * @param Table $table |
||
28 | * @param ForeignKeyConstraint $foreignKey |
||
29 | * @param SchemaAnalyzer $schemaAnalyzer |
||
30 | * @param NamingStrategyInterface $namingStrategy |
||
31 | */ |
||
32 | public function __construct(Table $table, ForeignKeyConstraint $foreignKey, SchemaAnalyzer $schemaAnalyzer, NamingStrategyInterface $namingStrategy) |
||
38 | |||
39 | /** |
||
40 | * Returns the foreignkey the column is part of, if any. null otherwise. |
||
41 | * |
||
42 | * @return ForeignKeyConstraint|null |
||
43 | */ |
||
44 | public function getForeignKey() |
||
48 | |||
49 | /** |
||
50 | * Returns the name of the class linked to this property or null if this is not a foreign key. |
||
51 | * |
||
52 | * @return null|string |
||
53 | */ |
||
54 | public function getClassName() |
||
58 | |||
59 | /** |
||
60 | * Returns the param annotation for this property (useful for constructor). |
||
61 | * |
||
62 | * @return string |
||
63 | */ |
||
64 | public function getParamAnnotation() |
||
70 | |||
71 | /** |
||
72 | * Returns true if the property is compulsory (and therefore should be fetched in the constructor). |
||
73 | * |
||
74 | * @return bool |
||
75 | */ |
||
76 | public function isCompulsory() |
||
90 | |||
91 | /** |
||
92 | * Returns true if the property has a default value. |
||
93 | * |
||
94 | * @return bool |
||
95 | */ |
||
96 | public function hasDefault() |
||
100 | |||
101 | /** |
||
102 | * Returns the code that assigns a value to its default value. |
||
103 | * |
||
104 | * @return string |
||
105 | * |
||
106 | * @throws \TDBMException |
||
107 | */ |
||
108 | public function assignToDefaultCode() |
||
112 | |||
113 | /** |
||
114 | * Returns true if the property is the primary key. |
||
115 | * |
||
116 | * @return bool |
||
117 | */ |
||
118 | public function isPrimaryKey() |
||
128 | |||
129 | /** |
||
130 | * Returns the PHP code for getters and setters. |
||
131 | * |
||
132 | * @return string |
||
133 | */ |
||
134 | public function getGetterSetterCode() |
||
167 | |||
168 | /** |
||
169 | * Returns the part of code useful when doing json serialization. |
||
170 | * |
||
171 | * @return string |
||
172 | */ |
||
173 | public function getJsonSerializeCode() |
||
181 | |||
182 | } |
||
183 |