Commit | Line | Data |
---|---|---|
5e434adf ARW |
1 | <?php |
2 | ||
3 | /** | |
4 | * Create classes which are used for schema introspection. | |
5 | */ | |
6 | class CRM_Core_CodeGen_Reflection extends CRM_Core_CodeGen_BaseTask { | |
4ef04170 | 7 | |
4ef04170 TO |
8 | /** |
9 | * @return bool | |
10 | * TRUE if an update is needed. | |
11 | */ | |
12 | public function needsUpdate() { | |
5079ecb1 TO |
13 | // Generating this file is fairly cheap, and we don't have robust heuristic |
14 | // for the checksum. | |
187c1c7c | 15 | return TRUE; |
5e434adf ARW |
16 | } |
17 | ||
8246bca4 | 18 | /** |
19 | * Run generator. | |
20 | */ | |
4ef04170 TO |
21 | public function run() { |
22 | echo "Generating table list\n"; | |
8fe9ce40 | 23 | $template = new CRM_Core_CodeGen_Util_Template('php', FALSE); |
5e434adf | 24 | $template->assign('tables', $this->tables); |
5079ecb1 | 25 | $template->assign('genCodeChecksum', 'IGNORE'); |
4ef04170 TO |
26 | $template->run('listAll.tpl', $this->getAbsFileName()); |
27 | } | |
28 | ||
29 | /** | |
8246bca4 | 30 | * Get absolute file name. |
31 | * | |
4ef04170 TO |
32 | * @return string |
33 | */ | |
34 | protected function getAbsFileName() { | |
35 | return $this->config->CoreDAOCodePath . "AllCoreTables.data.php"; | |
36 | } | |
5e434adf | 37 | |
5e434adf | 38 | } |