\NetCommonsMigration

NetCommonsMigration

Summary

Methods
Properties
Constants
run()
generateModel()
updateRecords()
deleteRecords()
loadModels()
updateAndDeleteRecords()
$records
No constants found
_invokeCallbacks()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$records

$records : array

plugin data

Type

array

Methods

run()

run(string  $direction) : boolean

Run migration

Parameters

string $direction

Direction of migration process (up or down)

Throws

\MigrationException

Returns

boolean —

Status of the process

generateModel()

generateModel(string  $name, string  $table = null, array  $options = array()) : \Model

Generate a instance of model for given options

Parameters

string $name

Model name to be initialized

string $table

Table name to be initialized

array $options

Model constructor options

Returns

\Model

updateRecords()

updateRecords(string  $model, array  $argRecords, boolean  $clear = false) : boolean

Update model records

Parameters

string $model

model name to update

array $argRecords

records to be stored

boolean $clear

初期化するかどうか

Returns

boolean —

Should process continue

deleteRecords()

deleteRecords(string  $model, array  $records, string  $key = 'id') : boolean

Delete model records

Parameters

string $model

model name to delete

array $records

records to be stored

string $key

削除条件項目

Returns

boolean —

Should process continue

loadModels()

loadModels(array  $models = array()) : void

Load models

Parameters

array $models

models to load

updateAndDeleteRecords()

updateAndDeleteRecords(string  $direction) : boolean

データ投入のマイグレーションupの更新と,downの削除

Parameters

string $direction

Direction of migration process (up or down)

Returns

boolean —

Should process continue

_invokeCallbacks()

_invokeCallbacks(string  $callback, string  $type, array  $data = array()) : void

This method will invoke the before/afterAction callbacks, it is good when you need track every action.

Parameters

string $callback

Callback name, beforeMigration, beforeAction, afterAction or afterMigration.

string $type

Type of action. i.e: create_table, drop_table, etc. Or also can be the direction, for before and after Migration callbacks

array $data

Data to send to the callback

Throws

\MigrationException