CRM_Core_CodeGen_DAO
class CRM_Core_CodeGen_DAO extends CRM_Core_CodeGen_BaseTask
Create DAO ORM classes.
Properties
protected CRM_Core_CodeGen_Main | $config | from CRM_Core_CodeGen_BaseTask | |
protected | $tables | from CRM_Core_CodeGen_BaseTask | |
string | $name |
Methods
CRM_Core_CodeGen_DAO constructor.
TODO: this is the most rudimentary possible hack. CG config should eventually be made into a first-class object.
No description
Extract a single regex from a file.
Determine if two snippets of PHP code are approximately equivalent.
Run generator.
Generate the raw PHP code for the DAO.
Get relative file name.
Get the absolute file name.
Get a unique signature for the table/schema.
Details
at line 36
__construct(CRM_Core_CodeGen_Main $config, string $name, string $tsFunctionName = 'ts')
CRM_Core_CodeGen_DAO constructor.
in CRM_Core_CodeGen_BaseTask at line 27
setConfig(object $config)
TODO: this is the most rudimentary possible hack. CG config should eventually be made into a first-class object.
at line 46
bool
needsUpdate()
in CRM_Core_CodeGen_BaseTask at line 50
static protected string|NULL
extractRegex(string $file, string $regex)
Extract a single regex from a file.
in CRM_Core_CodeGen_BaseTask at line 75
protected bool
isApproxPhpMatch($actual, $expected)
Determine if two snippets of PHP code are approximately equivalent.
This includes exceptions to equivalence for (a) whitespace and (b) the token "GenCodeChecksum".
This is useful for determining if someone has manually mucked with one the files. However, it's not perfect -- because whitespace changes are not detected. Hence, it's good to use in combination with another heuristic.
at line 63
run()
Run generator.
at line 89
string
getRaw()
Generate the raw PHP code for the DAO.
at line 111
string
getRelFileName()
Get relative file name.
at line 120
string
getAbsFileName()
Get the absolute file name.
at line 132
protected string
getTableChecksum()
Get a unique signature for the table/schema.