PHP Class Cml\Console\Commands\Migrate\AbstractCommand

Inheritance: extends Cml\Console\Command
Show file Open project: linhecheng/cmlphp

Protected Properties

Property Type Description
$adapter Phinx\Db\Adapter\AdapterInterface
$config Phinx\Config\Config
$manager Phinx\Migration\Manager

Public Methods

Method Description
bootstrap ( array $args, array $options = [] ) Bootstrap Phinx.
getAdapter ( ) : Phinx\Db\Adapter\AdapterInterface Gets the database adapter.
getConfig ( ) : Phinx\Config\Config Gets the config.
getManager ( ) : Phinx\Migration\Manager Gets the migration manager.
setAdapter ( Phinx\Db\Adapter\AdapterInterface $adapter ) : AbstractCommand Sets the database adapter.
setConfig ( Phinx\Config\Config $config ) : AbstractCommand Sets the config.
setManager ( Phinx\Migration\Manager $manager ) : AbstractCommand Sets the migration manager.

Protected Methods

Method Description
getMigrationTemplateFilename ( ) : string Returns the migration template filename.
getSeedTemplateFilename ( ) : string Returns the seed template filename.
loadConfig ( array $options ) : void Parse the config file and load it into the config object
loadManager ( array $args, array $options ) Load the migrations manager and inject the config
verifyMigrationDirectory ( string $path ) : void Verify that the migration directory exists and is writable.
verifySeedDirectory ( string $path ) : void Verify that the seed directory exists and is writable.

Method Details

bootstrap() public method

Bootstrap Phinx.
public bootstrap ( array $args, array $options = [] )
$args array
$options array

getAdapter() public method

Gets the database adapter.
public getAdapter ( ) : Phinx\Db\Adapter\AdapterInterface
return Phinx\Db\Adapter\AdapterInterface

getConfig() public method

Gets the config.
public getConfig ( ) : Phinx\Config\Config
return Phinx\Config\Config

getManager() public method

Gets the migration manager.
public getManager ( ) : Phinx\Migration\Manager
return Phinx\Migration\Manager

getMigrationTemplateFilename() protected method

Returns the migration template filename.
protected getMigrationTemplateFilename ( ) : string
return string

getSeedTemplateFilename() protected method

Returns the seed template filename.
protected getSeedTemplateFilename ( ) : string
return string

loadConfig() protected method

Parse the config file and load it into the config object
protected loadConfig ( array $options ) : void
$options array 选项
return void

loadManager() protected method

Load the migrations manager and inject the config
protected loadManager ( array $args, array $options )
$args array
$options array

setAdapter() public method

Sets the database adapter.
public setAdapter ( Phinx\Db\Adapter\AdapterInterface $adapter ) : AbstractCommand
$adapter Phinx\Db\Adapter\AdapterInterface
return AbstractCommand

setConfig() public method

Sets the config.
public setConfig ( Phinx\Config\Config $config ) : AbstractCommand
$config Phinx\Config\Config
return AbstractCommand

setManager() public method

Sets the migration manager.
public setManager ( Phinx\Migration\Manager $manager ) : AbstractCommand
$manager Phinx\Migration\Manager
return AbstractCommand

verifyMigrationDirectory() protected method

Verify that the migration directory exists and is writable.
protected verifyMigrationDirectory ( string $path ) : void
$path string
return void

verifySeedDirectory() protected method

Verify that the seed directory exists and is writable.
protected verifySeedDirectory ( string $path ) : void
$path string
return void

Property Details

$adapter protected property

protected AdapterInterface,Phinx\Db\Adapter $adapter
return Phinx\Db\Adapter\AdapterInterface

$config protected property

protected Config,Phinx\Config $config
return Phinx\Config\Config

$manager protected property

protected Manager,Phinx\Migration $manager
return Phinx\Migration\Manager