1 | <?php |
||
13 | abstract class AbstractBeanPropertyDescriptor |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * @var Table |
||
18 | */ |
||
19 | protected $table; |
||
20 | |||
21 | /** |
||
22 | * Whether to use the more complex name in case of conflict. |
||
23 | * @var bool |
||
24 | */ |
||
25 | protected $alternativeName = false; |
||
26 | |||
27 | /** |
||
28 | * @param Table $table |
||
29 | */ |
||
30 | public function __construct(Table $table) |
||
34 | |||
35 | |||
36 | /** |
||
37 | * Use the more complex name in case of conflict. |
||
38 | */ |
||
39 | public function useAlternativeName() |
||
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 | abstract public function getClassName(); |
||
49 | |||
50 | /** |
||
51 | * Returns the param annotation for this property (useful for constructor). |
||
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | abstract public function getParamAnnotation(); |
||
56 | |||
57 | public function getVariableName() { |
||
60 | |||
61 | public function getLowerCamelCaseName() { |
||
64 | |||
65 | abstract public function getUpperCamelCaseName(); |
||
66 | |||
67 | public function getSetterName() { |
||
70 | |||
71 | public function getGetterName() { |
||
74 | |||
75 | /** |
||
76 | * Returns the PHP code used in the ben constructor for this property. |
||
77 | * @return string |
||
78 | */ |
||
79 | public function getConstructorAssignCode() { |
||
83 | |||
84 | /** |
||
85 | * Returns true if the property is compulsory (and therefore should be fetched in the constructor). |
||
86 | * @return bool |
||
87 | */ |
||
88 | abstract public function isCompulsory(); |
||
89 | |||
90 | /** |
||
91 | * Returns true if the property is the primary key |
||
92 | * @return bool |
||
93 | */ |
||
94 | abstract public function isPrimaryKey(); |
||
95 | |||
96 | /** |
||
97 | * @return Table |
||
98 | */ |
||
99 | public function getTable() |
||
103 | |||
104 | /** |
||
105 | * Returns the PHP code for getters and setters |
||
106 | * @return string |
||
107 | */ |
||
108 | abstract public function getGetterSetterCode(); |
||
109 | |||
110 | /** |
||
111 | * Returns the part of code useful when doing json serialization. |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | abstract public function getJsonSerializeCode(); |
||
116 | } |