PHP Class yupe\components\Migrator

Inheritance: extends CApplicationComponent
Afficher le fichier Open project: yupe/yupe Class Usage Examples

Méthodes publiques

Свойство Type Description
$connectionID string
$migrationTable string

Méthodes publiques

Méthode 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 Обновление до актуальной миграции:

Méthodes protégées

Méthode 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 méthode

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

checkForUpdates() public méthode

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

createMigrationHistoryTable() protected méthode

Create migration history table
protected createMigrationHistoryTable ( ) : nothing
Résultat nothing

getDbConnection() protected méthode

Connect to DB
protected getDbConnection ( ) : db
Résultat db connection or make exception

getInstalledModulesList() public méthode

Return installed modules id
public getInstalledModulesList ( ) : array
Résultat array

getMigrationHistory() public méthode

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

getModulesWithDBInstalled() public méthode

Return db-installed modules list
public getModulesWithDBInstalled ( ) : mixed
Résultat mixed db-installed

getNewMigrations() protected méthode

Check for new migrations for module
protected getNewMigrations ( string $module ) : mixed
$module string - required module
Résultat mixed new migrations

init() public méthode

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

instantiateMigration() protected méthode

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

migrateDown() public méthode

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

migrateUp() protected méthode

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

updateToLatest() public méthode

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

Property Details

$connectionID public_oe property

public string $connectionID
Résultat string

$migrationTable public_oe property

public string $migrationTable
Résultat string