\Phinx\SeedSeedInterface

Seed interface

Summary

Methods
Constants
run()
setAdapter()
getAdapter()
setInput()
getInput()
setOutput()
getOutput()
getName()
execute()
query()
fetchRow()
fetchAll()
insert()
hasTable()
table()
RUN
No protected methods found
N/A
No private methods found
N/A

Constants

RUN

RUN = 'run' : string

Methods

run()

run() : void

Run the seeder.

setAdapter()

setAdapter(\Phinx\Db\Adapter\AdapterInterface  $adapter) : \Phinx\Seed\MigrationInterface

Sets the database adapter.

Parameters

\Phinx\Db\Adapter\AdapterInterface $adapter

Database Adapter

Returns

\Phinx\Seed\MigrationInterface

setInput()

setInput(\think\console\Input  $input) : \Phinx\Seed\MigrationInterface

Sets the input object to be used in migration object

Parameters

\think\console\Input $input

Returns

\Phinx\Seed\MigrationInterface

getInput()

getInput() : \think\console\Input

Gets the input object to be used in migration object

Returns

\think\console\Input

setOutput()

setOutput(\think\console\Output  $output) : \Phinx\Seed\MigrationInterface

Sets the output object to be used in migration object

Parameters

\think\console\Output $output

Returns

\Phinx\Seed\MigrationInterface

getOutput()

getOutput() : \think\console\Output

Gets the output object to be used in migration object

Returns

\think\console\Output

getName()

getName() : string

Gets the name.

Returns

string

execute()

execute(string  $sql) : integer

Executes a SQL statement and returns the number of affected rows.

Parameters

string $sql

SQL

Returns

integer

query()

query(string  $sql) : array

Executes a SQL statement and returns the result as an array.

Parameters

string $sql

SQL

Returns

array

fetchRow()

fetchRow(string  $sql) : array

Executes a query and returns only one row as an array.

Parameters

string $sql

SQL

Returns

array

fetchAll()

fetchAll(string  $sql) : array

Executes a query and returns an array of rows.

Parameters

string $sql

SQL

Returns

array

insert()

insert(string  $tableName, array  $data) : void

Insert data into a table.

Parameters

string $tableName
array $data

hasTable()

hasTable(string  $tableName) : boolean

Checks to see if a table exists.

Parameters

string $tableName

Table Name

Returns

boolean

table()

table(string  $tableName, array  $options) : \Phinx\Db\Table

Returns an instance of the <code>\Table</code> class.

You can use this class to create and manipulate tables.

Parameters

string $tableName

Table Name

array $options

Options

Returns

\Phinx\Db\Table