1 | <?php |
||
14 | class ObjectBeanPropertyDescriptor extends AbstractBeanPropertyDescriptor |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * @var ForeignKeyConstraint |
||
19 | */ |
||
20 | private $foreignKey; |
||
21 | |||
22 | /** |
||
23 | * @var SchemaAnalyzer |
||
24 | */ |
||
25 | private $schemaAnalyzer; |
||
26 | |||
27 | public function __construct(Table $table, ForeignKeyConstraint $foreignKey, SchemaAnalyzer $schemaAnalyzer) { |
||
28 | parent::__construct($table); |
||
29 | $this->foreignKey = $foreignKey; |
||
30 | $this->schemaAnalyzer = $schemaAnalyzer; |
||
31 | } |
||
32 | |||
33 | |||
34 | |||
35 | /** |
||
36 | * Returns the foreignkey the column is part of, if any. null otherwise. |
||
37 | * |
||
38 | * @return ForeignKeyConstraint|null |
||
39 | */ |
||
40 | public function getForeignKey() { |
||
43 | |||
44 | /** |
||
45 | * Returns the name of the class linked to this property or null if this is not a foreign key |
||
46 | * @return null|string |
||
47 | */ |
||
48 | public function getClassName() { |
||
51 | |||
52 | /** |
||
53 | * Returns the param annotation for this property (useful for constructor). |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | public function getParamAnnotation() { |
||
61 | |||
62 | public function getUpperCamelCaseName() { |
||
88 | |||
89 | /** |
||
90 | * Returns true if the property is compulsory (and therefore should be fetched in the constructor). |
||
91 | * @return bool |
||
92 | */ |
||
93 | public function isCompulsory() { |
||
106 | |||
107 | /** |
||
108 | * Returns true if the property is the primary key |
||
109 | * @return bool |
||
110 | */ |
||
111 | public function isPrimaryKey() { |
||
120 | |||
121 | /** |
||
122 | * Returns the PHP code for getters and setters |
||
123 | * @return string |
||
124 | */ |
||
125 | public function getGetterSetterCode() { |
||
153 | |||
154 | /** |
||
155 | * Returns the part of code useful when doing json serialization. |
||
156 | * |
||
157 | * @return string |
||
158 | */ |
||
159 | public function getJsonSerializeCode() |
||
166 | } |
||
167 |