Class Mage_Core_Model_Resource_Setup

Description

Resource setup model

Located in /Core/Model/Resource/Setup.php (line 32)


	
			
Direct descendents
Class Description
Mage_CatalogIndex_Model_Mysql4_Setup Magento
Mage_ImportExport_Model_Mysql4_Setup ImportExport setup model
Mage_Index_Model_Mysql4_Setup Magento
Mage_Eav_Model_Entity_Setup EAV Entity Setup Model
Mage_Sendfriend_Model_Mysql4_Setup Sendfriend module Setup Model
Class Constant Summary
Variable Summary
static bool $_hadUpdates
static mixed $_schemaUpdatesChecked
Varien_Db_Adapter_Pdo_Mysql $_conn
mixed $_setupCache
mixed $_tables
Method Summary
static void applyAllDataUpdates ()
static boolean applyAllUpdates ()
Mage_Core_Model_Resource_Setup __construct ( $resourceName)
void addConfigField ( $path,  $label, [ $data = array()], [ $default = null])
void applyUpdates ()
Mage_Core_Model_Resource_Setup deleteConfigData (string $path, [string $scope = null])
Mage_Core_Model_Resource_Setup deleteTableRow (string $table, string $idField, string|int $id, [null|string $parentField = null], [int|string $parentId = 0])
void endSetup ()
Varien_Db_Adapter_Pdo_Mysql getConnection ()
string getTable (string $tableName)
mixed|boolean getTableRow (string $table, string $idField, string|integer $id, [string $field = null], [string $parentField = null], [string|integer $parentId = 0])
void run ( $sql)
void setConfigData ( $path,  $value, [ $scope = 'default'], [ $scopeId = 0], [ $inherit = 0])
Mage_Core_Model_Resource_Setup setTable (string $tableName, string $realTableName)
void startSetup ()
void tableExists ( $table)
void updateTable ( $table,  $conditionExpr,  $valueExpr)
Mage_Eav_Model_Entity_Setup updateTableRow (string $table, string $idField, string|integer $id, string|array $field, [mixed|null $value = null], [string $parentField = null], [string|integer $parentId = 0])
array _getModifySqlFiles ($actionType $actionType,  $fromVersion,  $toVersion,  $arrFiles)
void _installData (string $newVersion)
boolean _installResourceDb ( $newVersion, string $version)
string _modifyResourceDb (string $actionType, string $fromVersion, string $toVersion)
bool _rollbackResourceDb (string $newVersion,  $oldVersion)
bool _uninstallResourceDb ($version $version)
void _upgradeData (string $oldVersion, string $newVersion)
void _upgradeResourceDb (string $oldVersion, string $newVersion)
Variables
static bool $_hadUpdates (line 65)

Flag wich allow to detect that some schema update was applied dueting request

  • access: protected
static mixed $_schemaUpdatesChecked (line 67)
  • access: protected
boolean $_callAfterApplyAllUpdates = false (line 49)

Call afterApplyAllUpdates method flag

  • access: protected
Varien_Db_Adapter_Pdo_Mysql $_conn (line 56)

Setup Connection

  • access: protected
mixed $_connectionConfig (line 41)
  • access: protected
mixed $_moduleConfig (line 42)
  • access: protected
mixed $_resourceConfig (line 40)
  • access: protected
mixed $_resourceName (line 39)
  • access: protected
mixed $_setupCache = array() (line 58)
  • access: protected
mixed $_tables = array() (line 57)
  • access: protected
Methods
static method applyAllDataUpdates (line 179)

Apply database data updates whenever needed

  • access: public
static void applyAllDataUpdates ()
static method applyAllUpdates (line 145)

Apply database updates whenever needed

  • access: public
static boolean applyAllUpdates ()
Constructor __construct (line 69)
  • access: public
Mage_Core_Model_Resource_Setup __construct ( $resourceName)
  • $resourceName
addConfigField (line 574)

***************** CONFIG ****************

  • access: public
void addConfigField ( $path,  $label, [ $data = array()], [ $default = null])
  • $path
  • $label
  • array $data
  • $default
afterApplyAllUpdates (line 675)

Run each time after applying of all updates, if setup model setted $_callAfterApplyAllUpdates flag to true

  • access: public
Mage_Core_Model_Resource_Setup afterApplyAllUpdates ()
applyDataUpdates (line 204)

Apply data updates to the system after upgrading.

  • access: public
Mage_Core_Model_Resource_Setup applyDataUpdates (string $fromVersion)
  • string $fromVersion
applyUpdates (line 221)

Apply module resource install, upgrade and data scripts

  • access: public
void applyUpdates ()

Redefined in descendants as:
deleteConfigData (line 624)

Delete config field values

  • access: public
Mage_Core_Model_Resource_Setup deleteConfigData (string $path, [string $scope = null])
  • string $path
  • string $scope: (default|stores|websites|config)
deleteTableRow (line 494)

Delete table row

  • access: public
Mage_Core_Model_Resource_Setup deleteTableRow (string $table, string $idField, string|int $id, [null|string $parentField = null], [int|string $parentId = 0])
  • string $table
  • string $idField
  • string|int $id
  • null|string $parentField
  • int|string $parentId
endSetup (line 650)
  • access: public
void endSetup ()
getCallAfterApplyAllUpdates (line 664)

Check call afterApplyAllUpdates method for setup class

  • access: public
boolean getCallAfterApplyAllUpdates ()
getConnection (line 98)

Get connection object

  • access: public
Varien_Db_Adapter_Pdo_Mysql getConnection ()
getTable (line 122)

Get table name by table placeholder

  • access: public
string getTable (string $tableName)
  • string $tableName
getTableRow (line 465)

Retrieve row or field from table by id or string and parent id

  • access: public
mixed|boolean getTableRow (string $table, string $idField, string|integer $id, [string $field = null], [string $parentField = null], [string|integer $parentId = 0])
  • string $table
  • string $idField
  • string|integer $id
  • string $field
  • string $parentField
  • string|integer $parentId
run (line 634)
  • access: public
void run ( $sql)
  • $sql
setConfigData (line 610)
  • access: public
void setConfigData ( $path,  $value, [ $scope = 'default'], [ $scopeId = 0], [ $inherit = 0])
  • $path
  • $value
  • $scope
  • $scopeId
  • $inherit
setTable (line 110)

Add table placeholder/table name relation

  • access: public
Mage_Core_Model_Resource_Setup setTable (string $tableName, string $realTableName)
  • string $tableName
  • string $realTableName
startSetup (line 640)
  • access: public
void startSetup ()
tableExists (line 565)
  • access: public
void tableExists ( $table)
  • $table
updateTable (line 555)
  • access: public
void updateTable ( $table,  $conditionExpr,  $valueExpr)
  • $table
  • $conditionExpr
  • $valueExpr
updateTableRow (line 524)

Update one or more fields of table row

  • access: public
Mage_Eav_Model_Entity_Setup updateTableRow (string $table, string $idField, string|integer $id, string|array $field, [mixed|null $value = null], [string $parentField = null], [string|integer $parentId = 0])
  • string $table
  • string $idField
  • string|integer $id
  • string|array $field
  • mixed|null $value
  • string $parentField
  • string|integer $parentId
_getModifySqlFiles (line 408)

Get sql files for modifications

  • access: protected
array _getModifySqlFiles ($actionType $actionType,  $fromVersion,  $toVersion,  $arrFiles)
  • $actionType $actionType
  • $fromVersion
  • $toVersion
  • $arrFiles
_getResource (line 135)

Get core resource resource model

  • access: protected
_installData (line 249)

Run data install scripts

  • access: protected
void _installData (string $newVersion)
  • string $newVersion
_installResourceDb (line 274)

Run resource installation file

  • access: protected
boolean _installResourceDb ( $newVersion, string $version)
  • string $version
  • $newVersion
_modifyResourceDb (line 326)

Run module modification files. Return version of last applied upgrade (false if no upgrades applied)

  • return: | false
  • access: protected
string _modifyResourceDb (string $actionType, string $fromVersion, string $toVersion)
  • string $actionType: install|upgrade|uninstall
  • string $fromVersion
  • string $toVersion
_rollbackResourceDb (line 300)

Roll back resource

  • access: protected
bool _rollbackResourceDb (string $newVersion,  $oldVersion)
  • string $newVersion
  • $oldVersion
_uninstallResourceDb (line 312)

Uninstall resource

  • access: protected
bool _uninstallResourceDb ($version $version)
  • $version $version: existing resource version
_upgradeData (line 262)

Run data upgrade scripts

  • access: protected
void _upgradeData (string $oldVersion, string $newVersion)
  • string $oldVersion
  • string $newVersion
_upgradeResourceDb (line 287)

Run resource upgrade files from $oldVersion to $newVersion

  • access: protected
void _upgradeResourceDb (string $oldVersion, string $newVersion)
  • string $oldVersion
  • string $newVersion
Class Constants
DEFAULT_SETUP_CONNECTION = 'core_setup' (line 34)
VERSION_COMPARE_EQUAL = 0 (line 35)
VERSION_COMPARE_GREATER = 1 (line 37)
VERSION_COMPARE_LOWER = -1 (line 36)

Documentation generated on Fri, 11 Feb 2011 17:12:28 +0200 by phpDocumentor 1.4.3