require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
+/**
+ * {$table.className} constructor.
+ */
class {$table.className} extends CRM_Core_DAO {ldelim}
/**
- * static instance to hold the table name
+ * Static instance to hold the table name.
*
* @var string
*/
static $_tableName = '{$table.name}';
/**
- * static value to see if we should log any modifications to
- * this table in the civicrm_log table
+ * Should CiviCRM log any modifications to this table in the civicrm_log table.
*
* @var boolean
*/
{/foreach} {* table.fields *}
/**
- * class constructor
- *
- * @return {$table.name}
+ * Class constructor.
*/
function __construct( ) {ldelim}
$this->__table = '{$table.name}';
{if $table.foreignKey || $table.dynamicForeignKey}
/**
- * Returns foreign keys and entity references
+ * Returns foreign keys and entity references.
*
* @return array
* [CRM_Core_Reference_Interface]
{foreach from=$table.fields item=field}
{if $field.uniqueName}
- '{$field.uniqueName}'
+ '{$field.uniqueName}'
{else}
'{$field.name}'
{/if}
=> array(
- 'name' => '{$field.name}',
+ 'name' => '{$field.name}',
'type' => {$field.crmType},
{if $field.title}
'title' => ts('{$field.title}'),
{if $field.default}
'default' => '{if ($field.default[0]=="'" or $field.default[0]=='"')}{$field.default|substring:1:-1}{else}{$field.default}{/if}',
{/if} {* field.default *}
+ 'table_name' => '{$table.name}',
+ 'entity' => '{$table.entity}',
+ 'bao' => '{$table.bao}',
+ 'localizable' => {if ($field.localizable)}{1}{else}{0}{/if},
{if $field.FKClassName}
'FKClassName' => '{$field.FKClassName}',
'pseudoconstant' => array(
{*{$pseudoOptions|@print_array}*}
{foreach from=$pseudoOptions key=optionKey item=optionValue}
- '{$optionKey}' => '{$optionValue}',
- {/foreach}
+ '{$optionKey}' => '{$optionValue}',
+{/foreach}
)
{/if} {* field.pseudoconstant *} ),
{/foreach} {* table.fields *}
return $r;
{rdelim}
+ /**
+ * Returns the list of indices
+ */
+ public static function indices($localize = TRUE) {ldelim}
+ $indices = {$indicesPhp};
+ return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
+ {rdelim}
{rdelim}
-
-