|
1 | 1 | <?php |
2 | 2 |
|
3 | 3 | /** |
4 | | - * @package CRM |
5 | | - * @copyright CiviCRM LLC (c) 2004-2018 |
| 4 | + * DAOs provide an OOP-style facade for reading and writing database records. |
6 | 5 | * |
7 | | - * Generated from /var/www/civicrm530/sites/default/files/civicrm/ext/au.com.agileware.elections/xml/schema/CRM/Elections/ElectionNomination.xml |
8 | | - * DO NOT EDIT. Generated by CRM_Core_CodeGen |
9 | | - * (GenCodeChecksum:f70ed2c39d539ddbd3176ffc9e97d5b9) |
10 | | - */ |
11 | | - |
12 | | -/** |
13 | | - * Database access object for the ElectionNomination entity. |
| 6 | + * DAOs are a primary source for metadata in older versions of CiviCRM (<5.74) |
| 7 | + * and are required for some subsystems (such as APIv3). |
| 8 | + * |
| 9 | + * This stub provides compatibility. It is not intended to be modified in a |
| 10 | + * substantive way. Property annotations may be added, but are not required. |
| 11 | + * @property string $id |
| 12 | + * @property string $comments |
| 13 | + * @property string $rejection_comments |
| 14 | + * @property bool|string $is_eligible_candidate |
| 15 | + * @property bool|string $has_accepted_nomination |
| 16 | + * @property bool|string $has_rejected_nomination |
| 17 | + * @property string $created_at |
| 18 | + * @property string $updated_at |
| 19 | + * @property string $member_nominee |
| 20 | + * @property string $election_position_id |
14 | 21 | */ |
15 | | -class CRM_Elections_DAO_ElectionNomination extends CRM_Core_DAO { |
| 22 | +class CRM_Elections_DAO_ElectionNomination extends CRM_Elections_DAO_Base { |
16 | 23 |
|
17 | 24 | /** |
18 | | - * Static instance to hold the table name. |
19 | | - * |
| 25 | + * Required by older versions of CiviCRM (<5.74). |
20 | 26 | * @var string |
21 | 27 | */ |
22 | | - static $_tableName = 'civicrm_election_nomination'; |
23 | | - |
24 | | - /** |
25 | | - * Should CiviCRM log any modifications to this table in the civicrm_log table. |
26 | | - * |
27 | | - * @var bool |
28 | | - */ |
29 | | - static $_log = TRUE; |
30 | | - |
31 | | - /** |
32 | | - * Unique ElectionNomination ID |
33 | | - * |
34 | | - * @var int unsigned |
35 | | - */ |
36 | | - public $id; |
37 | | - |
38 | | - /** |
39 | | - * @var text |
40 | | - */ |
41 | | - public $comments; |
42 | | - |
43 | | - /** |
44 | | - * @var text |
45 | | - */ |
46 | | - public $rejection_comments; |
47 | | - |
48 | | - /** |
49 | | - * Boolean field to identity if nomination is a valid candidate. |
50 | | - * |
51 | | - * @var boolean |
52 | | - */ |
53 | | - public $is_eligible_candidate; |
54 | | - |
55 | | - /** |
56 | | - * Boolean field to identity if nomination has been accepted by candidate. |
57 | | - * |
58 | | - * @var boolean |
59 | | - */ |
60 | | - public $has_accepted_nomination; |
61 | | - |
62 | | - /** |
63 | | - * Boolean field to identity if nomination has been rejected by candidate. |
64 | | - * |
65 | | - * @var boolean |
66 | | - */ |
67 | | - public $has_rejected_nomination; |
68 | | - |
69 | | - /** |
70 | | - * Date on which election nomination created. |
71 | | - * |
72 | | - * @var timestamp |
73 | | - */ |
74 | | - public $created_at; |
75 | | - |
76 | | - /** |
77 | | - * Date on which election nomination was updated. |
78 | | - * |
79 | | - * @var timestamp |
80 | | - */ |
81 | | - public $updated_at; |
82 | | - |
83 | | - /** |
84 | | - * FK to Contact for which this nomination is added. |
85 | | - * |
86 | | - * @var int unsigned |
87 | | - */ |
88 | | - public $member_nominee; |
89 | | - |
90 | | - /** |
91 | | - * FK to ElectionPosition for which this nomination is added. |
92 | | - * |
93 | | - * @var int unsigned |
94 | | - */ |
95 | | - public $election_position_id; |
96 | | - |
97 | | - /** |
98 | | - * Class constructor. |
99 | | - */ |
100 | | - public function __construct() { |
101 | | - $this->__table = 'civicrm_election_nomination'; |
102 | | - parent::__construct(); |
103 | | - } |
104 | | - |
105 | | - /** |
106 | | - * Returns foreign keys and entity references. |
107 | | - * |
108 | | - * @return array |
109 | | - * [CRM_Core_Reference_Interface] |
110 | | - */ |
111 | | - public static function getReferenceColumns() { |
112 | | - if (!isset(Civi::$statics[__CLASS__]['links'])) { |
113 | | - Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); |
114 | | - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'member_nominee', 'civicrm_contact', 'id'); |
115 | | - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'election_position_id', 'civicrm_election_position', 'id'); |
116 | | - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
117 | | - } |
118 | | - return Civi::$statics[__CLASS__]['links']; |
119 | | - } |
120 | | - |
121 | | - /** |
122 | | - * Returns all the column names of this table |
123 | | - * |
124 | | - * @return array |
125 | | - */ |
126 | | - public static function &fields() { |
127 | | - if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
128 | | - Civi::$statics[__CLASS__]['fields'] = [ |
129 | | - 'id' => [ |
130 | | - 'name' => 'id', |
131 | | - 'type' => CRM_Utils_Type::T_INT, |
132 | | - 'description' => 'Unique ElectionNomination ID', |
133 | | - 'required' => TRUE, |
134 | | - 'table_name' => 'civicrm_election_nomination', |
135 | | - 'entity' => 'ElectionNomination', |
136 | | - 'bao' => 'CRM_Elections_DAO_ElectionNomination', |
137 | | - 'localizable' => 0, |
138 | | - ], |
139 | | - 'comments' => [ |
140 | | - 'name' => 'comments', |
141 | | - 'type' => CRM_Utils_Type::T_TEXT, |
142 | | - 'title' => ts('Comments'), |
143 | | - 'import' => TRUE, |
144 | | - 'where' => 'civicrm_election_nomination.comments', |
145 | | - 'headerPattern' => '', |
146 | | - 'dataPattern' => '', |
147 | | - 'export' => TRUE, |
148 | | - 'table_name' => 'civicrm_election_nomination', |
149 | | - 'entity' => 'ElectionNomination', |
150 | | - 'bao' => 'CRM_Elections_DAO_ElectionNomination', |
151 | | - 'localizable' => 0, |
152 | | - 'html' => [ |
153 | | - 'type' => 'Text', |
154 | | - ], |
155 | | - ], |
156 | | - 'rejection_comments' => [ |
157 | | - 'name' => 'rejection_comments', |
158 | | - 'type' => CRM_Utils_Type::T_TEXT, |
159 | | - 'title' => ts('Rejection Comments'), |
160 | | - 'import' => TRUE, |
161 | | - 'where' => 'civicrm_election_nomination.rejection_comments', |
162 | | - 'headerPattern' => '', |
163 | | - 'dataPattern' => '', |
164 | | - 'export' => TRUE, |
165 | | - 'table_name' => 'civicrm_election_nomination', |
166 | | - 'entity' => 'ElectionNomination', |
167 | | - 'bao' => 'CRM_Elections_DAO_ElectionNomination', |
168 | | - 'localizable' => 0, |
169 | | - 'html' => [ |
170 | | - 'type' => 'Text', |
171 | | - ], |
172 | | - ], |
173 | | - 'is_eligible_candidate' => [ |
174 | | - 'name' => 'is_eligible_candidate', |
175 | | - 'type' => CRM_Utils_Type::T_BOOLEAN, |
176 | | - 'description' => 'Boolean field to identity if nomination is a valid candidate.', |
177 | | - 'import' => TRUE, |
178 | | - 'where' => 'civicrm_election_nomination.is_eligible_candidate', |
179 | | - 'headerPattern' => '', |
180 | | - 'dataPattern' => '', |
181 | | - 'export' => TRUE, |
182 | | - 'table_name' => 'civicrm_election_nomination', |
183 | | - 'entity' => 'ElectionNomination', |
184 | | - 'bao' => 'CRM_Elections_DAO_ElectionNomination', |
185 | | - 'localizable' => 0, |
186 | | - 'html' => [ |
187 | | - 'type' => 'CheckBox', |
188 | | - ], |
189 | | - ], |
190 | | - 'has_accepted_nomination' => [ |
191 | | - 'name' => 'has_accepted_nomination', |
192 | | - 'type' => CRM_Utils_Type::T_BOOLEAN, |
193 | | - 'title' => ts('Has Accepted Nomination'), |
194 | | - 'description' => 'Boolean field to identity if nomination has been accepted by candidate.', |
195 | | - 'import' => TRUE, |
196 | | - 'where' => 'civicrm_election_nomination.has_accepted_nomination', |
197 | | - 'headerPattern' => '', |
198 | | - 'dataPattern' => '', |
199 | | - 'export' => TRUE, |
200 | | - 'table_name' => 'civicrm_election_nomination', |
201 | | - 'entity' => 'ElectionNomination', |
202 | | - 'bao' => 'CRM_Elections_DAO_ElectionNomination', |
203 | | - 'localizable' => 0, |
204 | | - 'html' => [ |
205 | | - 'type' => 'CheckBox', |
206 | | - ], |
207 | | - ], |
208 | | - 'has_rejected_nomination' => [ |
209 | | - 'name' => 'has_rejected_nomination', |
210 | | - 'type' => CRM_Utils_Type::T_BOOLEAN, |
211 | | - 'title' => ts('Has Rejected Nomination'), |
212 | | - 'description' => 'Boolean field to identity if nomination has been rejected by candidate.', |
213 | | - 'import' => TRUE, |
214 | | - 'where' => 'civicrm_election_nomination.has_rejected_nomination', |
215 | | - 'headerPattern' => '', |
216 | | - 'dataPattern' => '', |
217 | | - 'export' => TRUE, |
218 | | - 'table_name' => 'civicrm_election_nomination', |
219 | | - 'entity' => 'ElectionNomination', |
220 | | - 'bao' => 'CRM_Elections_DAO_ElectionNomination', |
221 | | - 'localizable' => 0, |
222 | | - 'html' => [ |
223 | | - 'type' => 'CheckBox', |
224 | | - ], |
225 | | - ], |
226 | | - 'created_at' => [ |
227 | | - 'name' => 'created_at', |
228 | | - 'type' => CRM_Utils_Type::T_TIMESTAMP, |
229 | | - 'title' => ts('Created At'), |
230 | | - 'description' => 'Date on which election nomination created.', |
231 | | - 'export' => TRUE, |
232 | | - 'where' => 'civicrm_election_nomination.created_at', |
233 | | - 'headerPattern' => '', |
234 | | - 'dataPattern' => '', |
235 | | - 'default' => 'CURRENT_TIMESTAMP', |
236 | | - 'table_name' => 'civicrm_election_nomination', |
237 | | - 'entity' => 'ElectionNomination', |
238 | | - 'bao' => 'CRM_Elections_DAO_ElectionNomination', |
239 | | - 'localizable' => 0, |
240 | | - ], |
241 | | - 'updated_at' => [ |
242 | | - 'name' => 'updated_at', |
243 | | - 'type' => CRM_Utils_Type::T_TIMESTAMP, |
244 | | - 'title' => ts('Updated At'), |
245 | | - 'description' => 'Date on which election nomination was updated.', |
246 | | - 'required' => FALSE, |
247 | | - 'export' => TRUE, |
248 | | - 'where' => 'civicrm_election_nomination.updated_at', |
249 | | - 'headerPattern' => '', |
250 | | - 'dataPattern' => '', |
251 | | - 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', |
252 | | - 'table_name' => 'civicrm_election_nomination', |
253 | | - 'entity' => 'ElectionNomination', |
254 | | - 'bao' => 'CRM_Elections_DAO_ElectionNomination', |
255 | | - 'localizable' => 0, |
256 | | - ], |
257 | | - 'member_nominee' => [ |
258 | | - 'name' => 'member_nominee', |
259 | | - 'type' => CRM_Utils_Type::T_INT, |
260 | | - 'title' => ts('Member Nominee'), |
261 | | - 'description' => 'FK to Contact for which this nomination is added.', |
262 | | - 'table_name' => 'civicrm_election_nomination', |
263 | | - 'entity' => 'ElectionNomination', |
264 | | - 'bao' => 'CRM_Elections_DAO_ElectionNomination', |
265 | | - 'FKClassName' => 'CRM_Contact_DAO_Contact', |
266 | | - 'localizable' => 0, |
267 | | - ], |
268 | | - 'election_position_id' => [ |
269 | | - 'name' => 'election_position_id', |
270 | | - 'type' => CRM_Utils_Type::T_INT, |
271 | | - 'title' => 'Election Position', |
272 | | - 'description' => 'FK to ElectionPosition for which this nomination is added.', |
273 | | - 'table_name' => 'civicrm_election_nomination', |
274 | | - 'where' => 'civicrm_election_nomination.election_position_id', |
275 | | - 'entity' => 'ElectionNomination', |
276 | | - 'bao' => 'CRM_Elections_DAO_ElectionNomination', |
277 | | - 'FKClassName' => 'CRM_Elections_DAO_ElectionPosition', |
278 | | - 'localizable' => 0, |
279 | | - ], |
280 | | - ]; |
281 | | - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
282 | | - } |
283 | | - return Civi::$statics[__CLASS__]['fields']; |
284 | | - } |
285 | | - |
286 | | - /** |
287 | | - * Return a mapping from field-name to the corresponding key (as used in fields()). |
288 | | - * |
289 | | - * @return array |
290 | | - * Array(string $name => string $uniqueName). |
291 | | - */ |
292 | | - public static function &fieldKeys() { |
293 | | - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
294 | | - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); |
295 | | - } |
296 | | - return Civi::$statics[__CLASS__]['fieldKeys']; |
297 | | - } |
298 | | - |
299 | | - /** |
300 | | - * Returns the names of this table |
301 | | - * |
302 | | - * @return string |
303 | | - */ |
304 | | - public static function getTableName() { |
305 | | - return self::$_tableName; |
306 | | - } |
307 | | - |
308 | | - /** |
309 | | - * Returns if this table needs to be logged |
310 | | - * |
311 | | - * @return bool |
312 | | - */ |
313 | | - public function getLog() { |
314 | | - return self::$_log; |
315 | | - } |
316 | | - |
317 | | - /** |
318 | | - * Returns the list of fields that can be imported |
319 | | - * |
320 | | - * @param bool $prefix |
321 | | - * |
322 | | - * @return array |
323 | | - */ |
324 | | - public static function &import($prefix = FALSE) { |
325 | | - $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'election_nomination', $prefix, []); |
326 | | - return $r; |
327 | | - } |
328 | | - |
329 | | - /** |
330 | | - * Returns the list of fields that can be exported |
331 | | - * |
332 | | - * @param bool $prefix |
333 | | - * |
334 | | - * @return array |
335 | | - */ |
336 | | - public static function &export($prefix = FALSE) { |
337 | | - $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'election_nomination', $prefix, []); |
338 | | - return $r; |
339 | | - } |
340 | | - |
341 | | - /** |
342 | | - * Returns the list of indices |
343 | | - * |
344 | | - * @param bool $localize |
345 | | - * |
346 | | - * @return array |
347 | | - */ |
348 | | - public static function indices($localize = TRUE) { |
349 | | - $indices = []; |
350 | | - return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
351 | | - } |
| 28 | + public static $_tableName = 'civicrm_election_nomination'; |
352 | 29 |
|
353 | 30 | } |
0 commit comments