PHP Class yupe\components\Migrator

Inheritance: extends CApplicationComponent
ファイルを表示 Open project: yupe/yupe Class Usage Examples

Public Properties

Property Type Description
$connectionID string
$migrationTable string

Public Methods

Method Description
checkForBadMigration ( string $module, boolean $class = false ) : boolean Проверяем на незавершённые миграции:
checkForUpdates ( array $modules ) : mixed Check each modules for new migrations
getInstalledModulesList ( ) : array Return installed modules id
getMigrationHistory ( string $module, integer $limit = 20 ) : mixed Check each modules for new migrations
getModulesWithDBInstalled ( ) : mixed Return db-installed modules list
init ( ) : parent:init() Инициализируем класс:
migrateDown ( string $module, string $class ) : boolean Даунгрейд миграции:
updateToLatest ( string $module ) : boolean Обновление до актуальной миграции:

Protected Methods

Method Description
createMigrationHistoryTable ( ) : nothing Create migration history table
getDbConnection ( ) : db Connect to DB
getNewMigrations ( string $module ) : mixed Check for new migrations for module
instantiateMigration ( string $module, string $class ) : mixed Check each modules for new migrations
migrateUp ( string $module, string $class ) : boolean Обновляем миграцию:

Method Details

checkForBadMigration() public method

Проверяем на незавершённые миграции:
public checkForBadMigration ( string $module, boolean $class = false ) : boolean
$module string - required module
$class boolean - migration class
return boolean is updated to migration

checkForUpdates() public method

Check each modules for new migrations
public checkForUpdates ( array $modules ) : mixed
$modules array - list of modules
return mixed new migrations

createMigrationHistoryTable() protected method

Create migration history table
protected createMigrationHistoryTable ( ) : nothing
return nothing

getDbConnection() protected method

Connect to DB
protected getDbConnection ( ) : db
return db connection or make exception

getInstalledModulesList() public method

Return installed modules id
public getInstalledModulesList ( ) : array
return array

getMigrationHistory() public method

Check each modules for new migrations
public getMigrationHistory ( string $module, integer $limit = 20 ) : mixed
$module string - required module
$limit integer - limit of array
return mixed version and apply time

getModulesWithDBInstalled() public method

Return db-installed modules list
public getModulesWithDBInstalled ( ) : mixed
return mixed db-installed

getNewMigrations() protected method

Check for new migrations for module
protected getNewMigrations ( string $module ) : mixed
$module string - required module
return mixed new migrations

init() public method

Инициализируем класс:
public init ( ) : parent:init()
return parent:init()

instantiateMigration() protected method

Check each modules for new migrations
protected instantiateMigration ( string $module, string $class ) : mixed
$module string - required module
$class string - class of migration
return mixed version and apply time

migrateDown() public method

Даунгрейд миграции:
public migrateDown ( string $module, string $class ) : boolean
$module string - required module
$class string - name of migration class
return boolean is downgraded from migration

migrateUp() protected method

Обновляем миграцию:
protected migrateUp ( string $module, string $class ) : boolean
$module string - required module
$class string - name of migration class
return boolean is updated to migration

updateToLatest() public method

Обновление до актуальной миграции:
public updateToLatest ( string $module ) : boolean
$module string - required module
return boolean if migration updated

Property Details

$connectionID public_oe property

public string $connectionID
return string

$migrationTable public_oe property

public string $migrationTable
return string