class MigrationsModel extends ModelRepository (View source)

The MigrationsModel class.

Traits

The DatabaseModelTrait class.
The CliOutputModelTrait class.
The BootableTrait class.
The MultiSingletonTrait class.

Methods

static SingletonTrait
getInstance(array $args)

getInstance

static mixed
setInstance(object $instance)

setInstance

__construct(Structure|array $config = null, Structure $state = null, mixed $source = null)

Instantiate the model.

mixed
__call(string $name, array $args = array())

__call

Structure
getConfig()

Method to get property Config

setConfig(Structure $config)

Method to set property config

string
getName()

Method to get property Name

setName(string $name)

Method to set property name

string
getCacheId(string $id = null)

getStoredId

Structure
getState()

Get the model state.

void
setState(Structure $state)

Set the model state.

mixed
get(string $key, mixed $default = null)

get

$this
set(string $key, mixed $value)

set

boolean
offsetExists(mixed $offset)

Is a property exists or not.

mixed
offsetGet(mixed $offset)

Get a property.

void
offsetSet(mixed $offset, mixed $value)

Set a value to property.

void
offsetUnset(mixed $offset)

Unset a property.

Structure
__get(string $name)

__get

void
bootDatabaseModelTrait(ModelRepository $model)

bootDatabaseModelTrait

AbstractDatabaseDriver
getDb()

getDb

setDb(AbstractDatabaseDriver $db)

setDb

transactionStart(boolean $nested = true)

transactionStart

transactionCommit(boolean $nested = true)

transactionCommit

transactionRollback(boolean $nested = true)

transactionRollback

out(string $text, bool $nl = true)

out

string
in()

in

IOInterface
getIo()

Method to get property Io

setIo(IOInterface $io)

Method to set property io

array|DataSet
getMigrations()

getMigrations

array
getVersions()

getVersions

int
getCurrentVersion()

getCurrentVersion

void
migrate(string $version = null)

migrate

void
executeMigration(Data $migrationItem, string $direction = 'up')

executeMigration

void
storeVersion(Data $migration, string $direction, string $start, string $end)

storeVersion

void
initLogTable(string $name = null)

initLogTable

mixed
getCommand()

Method to get property Command

setCommand(AbstractCommand $command)

Method to set property command

Details

static SingletonTrait getInstance(array $args)

getInstance

Parameters

array $args

Return Value

SingletonTrait

static mixed setInstance(object $instance)

setInstance

Parameters

object $instance

Return Value

mixed

__construct(Structure|array $config = null, Structure $state = null, mixed $source = null)

Instantiate the model.

Parameters

Structure|array $config The model config.
Structure $state The model state.
mixed $source The data source.

mixed __call(string $name, array $args = array())

__call

Parameters

string $name
array $args

Return Value

mixed

Exceptions

InvalidArgumentException

Structure getConfig()

Method to get property Config

Return Value

Structure

ModelRepository setConfig(Structure $config)

Method to set property config

Parameters

Structure $config

Return Value

ModelRepository Return self to support chaining.

string getName()

Method to get property Name

Return Value

string

ModelRepository setName(string $name)

Method to set property name

Parameters

string $name

Return Value

ModelRepository Return self to support chaining.

string getCacheId(string $id = null)

getStoredId

Parameters

string $id

Return Value

string

ModelRepository resetCache()

resetCache

Return Value

ModelRepository

Structure getState()

Get the model state.

Return Value

Structure The state object.

void setState(Structure $state)

Set the model state.

Parameters

Structure $state The state object.

Return Value

void

mixed get(string $key, mixed $default = null)

get

Parameters

string $key
mixed $default

Return Value

mixed

$this set(string $key, mixed $value)

set

Parameters

string $key
mixed $value

Return Value

$this

ModelRepository reset()

reset

Return Value

ModelRepository

boolean offsetExists(mixed $offset)

Is a property exists or not.

Parameters

mixed $offset Offset key.

Return Value

boolean

mixed offsetGet(mixed $offset)

Get a property.

Parameters

mixed $offset Offset key.

Return Value

mixed The value to return.

Exceptions

InvalidArgumentException

void offsetSet(mixed $offset, mixed $value)

Set a value to property.

Parameters

mixed $offset Offset key.
mixed $value The value to set.

Return Value

void

Exceptions

InvalidArgumentException

void offsetUnset(mixed $offset)

Unset a property.

Parameters

mixed $offset Offset key to unset.

Return Value

void

Exceptions

InvalidArgumentException

Structure __get(string $name)

__get

Parameters

string $name

Return Value

Structure

void bootDatabaseModelTrait(ModelRepository $model)

bootDatabaseModelTrait

Parameters

ModelRepository $model

Return Value

void

AbstractDatabaseDriver getDb()

getDb

Return Value

AbstractDatabaseDriver

DatabaseModelTrait setDb(AbstractDatabaseDriver $db)

setDb

Parameters

AbstractDatabaseDriver $db

Return Value

DatabaseModelTrait Return self to support chaining.

DatabaseModelTrait transactionStart(boolean $nested = true)

transactionStart

Parameters

boolean $nested

Return Value

DatabaseModelTrait

DatabaseModelTrait transactionCommit(boolean $nested = true)

transactionCommit

Parameters

boolean $nested

Return Value

DatabaseModelTrait

DatabaseModelTrait transactionRollback(boolean $nested = true)

transactionRollback

Parameters

boolean $nested

Return Value

DatabaseModelTrait

CliOutputModelTrait out(string $text, bool $nl = true)

out

Parameters

string $text
bool $nl

Return Value

CliOutputModelTrait

string in()

in

Return Value

string

IOInterface getIo()

Method to get property Io

Return Value

IOInterface

CliOutputModelTrait setIo(IOInterface $io)

Method to set property io

Parameters

IOInterface $io

Return Value

CliOutputModelTrait Return self to support chaining.

at line line 52
array|DataSet getMigrations()

getMigrations

Return Value

array|DataSet

at line line 93
array getVersions()

getVersions

Return Value

array

at line line 110
int getCurrentVersion()

getCurrentVersion

Return Value

int

at line line 129
void migrate(string $version = null)

migrate

Parameters

string $version

Return Value

void

at line line 211
void executeMigration(Data $migrationItem, string $direction = 'up')

executeMigration

Parameters

Data $migrationItem
string $direction

Return Value

void

Exceptions

Exception

at line line 273
void storeVersion(Data $migration, string $direction, string $start, string $end)

storeVersion

Parameters

Data $migration
string $direction
string $start
string $end

Return Value

void

at line line 300
void initLogTable(string $name = null)

initLogTable

Parameters

string $name

Return Value

void

at line line 324
mixed getCommand()

Method to get property Command

Return Value

mixed

at line line 336
MigrationsModel setCommand(AbstractCommand $command)

Method to set property command

Parameters

AbstractCommand $command

Return Value

MigrationsModel Return self to support chaining.