1 | <?php |
||
10 | abstract class AbstractBeanPropertyDescriptor |
||
11 | { |
||
12 | /** |
||
13 | * @var Table |
||
14 | */ |
||
15 | protected $table; |
||
16 | |||
17 | /** |
||
18 | * Whether to use the more complex name in case of conflict. |
||
19 | * |
||
20 | * @var bool |
||
21 | */ |
||
22 | protected $alternativeName = false; |
||
23 | |||
24 | /** |
||
25 | * @param Table $table |
||
26 | */ |
||
27 | public function __construct(Table $table) |
||
31 | |||
32 | /** |
||
33 | * Use the more complex name in case of conflict. |
||
34 | */ |
||
35 | public function useAlternativeName() |
||
39 | |||
40 | /** |
||
41 | * Returns the name of the class linked to this property or null if this is not a foreign key. |
||
42 | * |
||
43 | * @return null|string |
||
44 | */ |
||
45 | abstract public function getClassName(); |
||
46 | |||
47 | /** |
||
48 | * Returns the param annotation for this property (useful for constructor). |
||
49 | * |
||
50 | * @return string |
||
51 | */ |
||
52 | abstract public function getParamAnnotation(); |
||
53 | |||
54 | public function getVariableName() |
||
58 | |||
59 | public function getLowerCamelCaseName() |
||
63 | |||
64 | abstract public function getUpperCamelCaseName(); |
||
65 | |||
66 | public function getSetterName() |
||
70 | |||
71 | public function getGetterName() |
||
75 | |||
76 | /** |
||
77 | * Returns the PHP code used in the ben constructor for this property. |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | public function getConstructorAssignCode() |
||
87 | |||
88 | /** |
||
89 | * Returns true if the property is compulsory (and therefore should be fetched in the constructor). |
||
90 | * |
||
91 | * @return bool |
||
92 | */ |
||
93 | abstract public function isCompulsory(); |
||
94 | |||
95 | /** |
||
96 | * Returns true if the property is the primary key. |
||
97 | * |
||
98 | * @return bool |
||
99 | */ |
||
100 | abstract public function isPrimaryKey(); |
||
101 | |||
102 | /** |
||
103 | * @return Table |
||
104 | */ |
||
105 | public function getTable() |
||
109 | |||
110 | /** |
||
111 | * Returns the PHP code for getters and setters. |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | abstract public function getGetterSetterCode(); |
||
116 | |||
117 | /** |
||
118 | * Returns the part of code useful when doing json serialization. |
||
119 | * |
||
120 | * @return string |
||
121 | */ |
||
122 | abstract public function getJsonSerializeCode(); |
||
123 | } |
||
124 |