AllCoreTables.data.php - generate every time.
[civicrm-core.git] / CRM / Core / CodeGen / Reflection.php
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 {
7
8 /**
9 * @return bool
10 * TRUE if an update is needed.
11 */
12 public function needsUpdate() {
13 // Generating this file is fairly cheap, and we don't have robust heuristic
14 // for the checksum.
15 return TRUE;
16 }
17
18 /**
19 * Run generator.
20 */
21 public function run() {
22 echo "Generating table list\n";
23 $template = new CRM_Core_CodeGen_Util_Template('php');
24 $template->assign('tables', $this->tables);
25 $template->assign('genCodeChecksum', 'IGNORE');
26 $template->run('listAll.tpl', $this->getAbsFileName());
27 }
28
29 /**
30 * Get absolute file name.
31 *
32 * @return string
33 */
34 protected function getAbsFileName() {
35 return $this->config->CoreDAOCodePath . "AllCoreTables.data.php";
36 }
37
38 }