<?php
-/*
- +--------------------------------------------------------------------+
- | CiviCRM version 4.7 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
- | |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
- | |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
- +--------------------------------------------------------------------+
-*/
-
/**
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2017
+ * @copyright CiviCRM LLC (c) 2004-2018
*
* Generated from {$table.sourceFile}
* {$generated}
* (GenCodeChecksum:{$genCodeChecksum})
*/
-require_once 'CRM/Core/DAO.php';
-require_once 'CRM/Utils/Type.php';
-
/**
- * {$table.className} constructor.
+ * Database access object for the {$table.entity} entity.
*/
class {$table.className} extends CRM_Core_DAO {ldelim}
/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
- * @var boolean
+ * @var bool
*/
- static $_log = {$table.log};
+ static $_log = {$table.log|strtoupper};
{foreach from=$table.fields item=field}
/**
{if $field.comment}
* {$field.comment}
-{/if}
*
+{/if}
* @var {$field.phpType}
*/
public ${$field.name};
/**
* Class constructor.
*/
- function __construct( ) {ldelim}
+ public function __construct( ) {ldelim}
$this->__table = '{$table.name}';
parent::__construct( );
* @return array
* [CRM_Core_Reference_Interface]
*/
- static function getReferenceColumns() {ldelim}
+ public static function getReferenceColumns() {ldelim}
if (!isset(Civi::$statics[__CLASS__]['links'])) {ldelim}
Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
{foreach from=$table.foreignKey item=foreign}
*
* @return array
*/
- static function &fields( ) {ldelim}
+ public static function &fields( ) {ldelim}
if ( ! isset(Civi::$statics[__CLASS__]['fields']) ) {ldelim}
- Civi::$statics[__CLASS__]['fields'] = array (
+ Civi::$statics[__CLASS__]['fields'] = array(
{foreach from=$table.fields item=field}
{if $field.uniqueName}
'description' => '{$field.comment|replace:"'":"\'"}',
{/if}
{if $field.required}
- 'required' => {$field.required},
+ 'required' => {$field.required|strtoupper},
{/if} {* field.required *}
{if $field.length}
'maxlength' => {$field.length},
{/if} {* field.cols *}
{if $field.import}
- 'import' => {$field.import},
+ 'import' => {$field.import|strtoupper},
'where' => '{$table.name}.{$field.name}',
'headerPattern' => '{$field.headerPattern}',
'dataPattern' => '{$field.dataPattern}',
{/if} {* field.import *}
{if $field.export}
- 'export' => {$field.export},
+ 'export' => {$field.export|strtoupper},
{if ! $field.import}
'where' => '{$table.name}.{$field.name}',
'headerPattern' => '{$field.headerPattern}',
{if $field.FKClassName}
'FKClassName' => '{$field.FKClassName}',
-{/if} {* field.FKClassName *}
+{/if}
+{if $field.serialize}
+ 'serialize' => self::SERIALIZE_{$field.serialize|strtoupper},
+{/if}
{if $field.html}
- {assign var=htmlOptions value=$field.html}
- 'html' => array(
-{*{$htmlOptions|@print_array}*}
- {foreach from=$htmlOptions key=optionKey item=optionValue}
- '{$optionKey}' => '{$optionValue}',
- {/foreach}
- ),
+ 'html' => {$field.html|@print_array},
{/if} {* field.html *}
{if $field.pseudoconstant}
-{assign var=pseudoOptions value=$field.pseudoconstant}
-'pseudoconstant' => array(
-{*{$pseudoOptions|@print_array}*}
-{foreach from=$pseudoOptions key=optionKey item=optionValue}
- '{$optionKey}' => '{$optionValue}',
-{/foreach}
- )
+ 'pseudoconstant' => {$field.pseudoconstant|@print_array}
{/if} {* field.pseudoconstant *} ),
{/foreach} {* table.fields *}
);
* @return array
* Array(string $name => string $uniqueName).
*/
- static function &fieldKeys( ) {ldelim}
+ public static function &fieldKeys( ) {ldelim}
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {ldelim}
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
{rdelim}
*
* @return string
*/
- static function getTableName( ) {ldelim}
+ public static function getTableName( ) {ldelim}
{if $table.localizable}
return CRM_Core_DAO::getLocaleTableName( self::$_tableName );
{else}
/**
* Returns if this table needs to be logged
*
- * @return boolean
+ * @return bool
*/
- function getLog( ) {ldelim}
+ public function getLog( ) {ldelim}
return self::$_log;
{rdelim}
*
* @return array
*/
- static function &import( $prefix = false ) {ldelim}
+ public static function &import( $prefix = FALSE ) {ldelim}
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, '{$table.labelName}', $prefix, array(
{if $table.foreignKey}{foreach from=$table.foreignKey item=foreign}
{if $foreign.import}'{$foreign.className}',{/if}
*
* @return array
*/
- static function &export( $prefix = false ) {ldelim}
+ public static function &export( $prefix = FALSE ) {ldelim}
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, '{$table.labelName}', $prefix, array(
{if $table.foreignKey}{foreach from=$table.foreignKey item=foreign}
{if $foreign.export}'{$foreign.className}',{/if}
/**
* Returns the list of indices
+ *
+ * @param bool $localize
+ *
+ * @return array
*/
public static function indices($localize = TRUE) {ldelim}
$indices = {$indicesPhp};
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
{rdelim}
+
{rdelim}