class CRM_Core_I18n_Schema

Methods

static 
dropAllViews()

Drop all views (for use by CRM_Core_DAO::dropAllTables() mostly).

static 
makeMultilingual(string $locale)

Switch database from single-lang to multi (by adding the first language and dropping the original columns).

static 
makeSinglelingual(string $retain)

Switch database from multi-lang back to single (by dropping additional columns and views and retaining only the selected locale).

static 
makeSinglelingualTable(string $retain, string $table, string $class = 'CRM_Core_I18n_SchemaStructure', array $triggers = array())

Switch a given table from multi-lang to single (by retaining only the selected locale).

static 
addLocale(string $locale, string $source)

Add a new locale to a multi-lang db, setting its values to the current default locale.

static 
rebuildMultilingualSchema(array $locales, string $version = NULL)

Rebuild multilingual indices, views and triggers (useful for upgrades)

static string
rewriteQuery(string $query)

Rewrite SQL query to use views to access tables with localized columns.

static array
schemaStructureTables(null $version = NULL, bool $force = FALSE)

No description

static mixed
getLatestSchema($version)

No description

static 
triggerInfo($info, null $tableName = NULL)

No description

Details

at line 38
static dropAllViews()

Drop all views (for use by CRM_Core_DAO::dropAllTables() mostly).

at line 62
static makeMultilingual(string $locale)

Switch database from single-lang to multi (by adding the first language and dropping the original columns).

Parameters

string $locale the first locale to create (migrate to).

at line 119
static makeSinglelingual(string $retain)

Switch database from multi-lang back to single (by dropping additional columns and views and retaining only the selected locale).

Parameters

string $retain the locale to retain.

at line 163
static makeSinglelingualTable(string $retain, string $table, string $class = 'CRM_Core_I18n_SchemaStructure', array $triggers = array())

Switch a given table from multi-lang to single (by retaining only the selected locale).

Parameters

string $retain the locale to retain.
string $table the table containing the column.
string $class schema structure class to use to recreate indices.
array $triggers

at line 242
static addLocale(string $locale, string $source)

Add a new locale to a multi-lang db, setting its values to the current default locale.

Parameters

string $locale the new locale to add.
string $source the locale to copy from.

at line 299
static rebuildMultilingualSchema(array $locales, string $version = NULL)

Rebuild multilingual indices, views and triggers (useful for upgrades)

Parameters

array $locales locales to be rebuilt.
string $version version of schema structure to use.

at line 364
static string rewriteQuery(string $query)

Rewrite SQL query to use views to access tables with localized columns.

Parameters

string $query the query for rewrite.

Return Value

string the rewritten query

at line 384
static array schemaStructureTables(null $version = NULL, bool $force = FALSE)

Parameters

null $version
bool $force

Return Value

array

at line 408
static mixed getLatestSchema($version)

Parameters

$version

Return Value

mixed

at line 511
static triggerInfo($info, null $tableName = NULL)

Parameters

$info
null $tableName