Skip to content

icms_db_legacy_updater_Handler

Raimondas Rimkevičius edited this page Mar 9, 2020 · 1 revision
Notice: Wiki was automatic generated from project sources as project API documentation. Do not edit manually!

icms_db_legacy_updater_Handler

icms_db_legacy_updater_Handler class

Class performing the database update for the module

  • Class name: icms_db_legacy_updater_Handler
  • Namespace:

Properties

$_db

public \icms_db_Connection $_db
  • Visibility: public

$db

public \icms_db_Connection $db
  • Visibility: public

$_messages

public array $_messages = array()
  • Visibility: public

Methods

__construct

mixed icms_db_legacy_updater_Handler::__construct()
  • Visibility: public

runQuery

bool icms_db_legacy_updater_Handler::runQuery(string query, string goodmsg, string badmsg, bool force)

Use to execute a general query

  • Visibility: public

Arguments

  • query string - <p>query that will be executed</p>
  • goodmsg string - <p>message displayed on success</p>
  • badmsg string - <p>message displayed on error</p>
  • force bool - <p>force the query even in a GET process</p>

renameTable

bool icms_db_legacy_updater_Handler::renameTable(string from, string to, bool force)

Use to rename a table

  • Visibility: public

Arguments

  • from string - <p>name of the table to rename</p>
  • to string - <p>new name of the renamed table</p>
  • force bool - <p>force the query even in a GET process</p>

uninstallObjectItem

bool icms_db_legacy_updater_Handler::uninstallObjectItem(string dirname, string item, array reservedTables)

Remove table or some rows if table is used for other object

  • Visibility: public

Arguments

  • dirname string
  • item string
  • reservedTables array

insertConfig

mixed icms_db_legacy_updater_Handler::insertConfig(int conf_catid, string conf_name, string conf_title, mixed conf_value, string conf_desc, string conf_formtype, string conf_valuetype, int conf_order)

Insert a config in System Preferences

  • Visibility: public

Arguments

  • conf_catid int
  • conf_name string
  • conf_title string
  • conf_value mixed
  • conf_desc string
  • conf_formtype string
  • conf_valuetype string
  • conf_order int

moduleUpgrade

mixed icms_db_legacy_updater_Handler::moduleUpgrade(mixed module, mixed tables_first)
  • Visibility: public

Arguments

  • module mixed
  • tables_first mixed

automaticUpgrade

mixed icms_db_legacy_updater_Handler::automaticUpgrade(string dirname, mixed item)

Upgrade automaticaly an item of a module

Note that currently, $item needs to represent the name of an object derived from SmartObject, for example, $item == 'invoice' wich will represent $dirnameInvoice for example SmartbillingInvoice which extends SmartObject class

  • Visibility: public

Arguments

  • dirname string - <p>dirname of the module</p>
  • item mixed - <p>name or array of names of the item to upgrade</p>

upgradeObjectItem

mixed icms_db_legacy_updater_Handler::upgradeObjectItem(string dirname, mixed item)

Upgrades the object

  • Visibility: public

Arguments

  • dirname string
  • item mixed

getFieldTypeFromVar

string icms_db_legacy_updater_Handler::getFieldTypeFromVar(array var)

Get the type of the field based on the info of the var

  • Visibility: public

Arguments

  • var array - <p>array containing information about the var</p>

getFieldDefaultFromVar

string icms_db_legacy_updater_Handler::getFieldDefaultFromVar(array var, bool key)

Get the default value based on the info of the var

  • Visibility: public

Arguments

  • var array - <p>array containing information about the var</p>
  • key bool - <p>TRUE if the var is the primary key</p>

updateTable

bool icms_db_legacy_updater_Handler::updateTable(\icms_db_legacy_updater_Table table, bool force)

Use to update a table

  • Visibility: public

Arguments

updateModuleDBVersion

bool icms_db_legacy_updater_Handler::updateModuleDBVersion(int newDBVersion, string dirname)

Update the DBVersion of a module

  • Visibility: public

Arguments

  • newDBVersion int - <p>new database version</p>
  • dirname string - <p>dirname of the module</p>
Clone this wiki locally