Метод |
Описание |
|
__construct ( Phinx\Db\Adapter\AdapterInterface $adapter, Connection $connection ) |
Constructor |
|
addColumn ( Phinx\Db\Table $table, Phinx\Db\Table\Column $column ) : void |
Adds the specified column to a database table. |
|
addForeignKey ( Phinx\Db\Table $table, Phinx\Db\Table\ForeignKey $foreignKey ) : void |
Adds the specified foreign key to a database table. |
|
addIndex ( Phinx\Db\Table $table, Phinx\Db\Table\Index $index ) : void |
Adds the specified index to a database table. |
|
beginTransaction ( ) : void |
Begin a transaction. |
|
changeColumn ( string $tableName, string $columnName, Phinx\Db\Table\Column $newColumn ) : Phinx\Db\Table |
Change a table column type. |
|
commitTransaction ( ) : void |
Commit a transaction. |
|
connect ( ) : void |
Initializes the database connection. |
|
createDatabase ( string $name, array $options = [] ) : void |
Creates a new database. |
|
createSchemaTable ( ) : void |
Creates the schema table. |
|
createTable ( Phinx\Db\Table $table ) : void |
Creates the specified database table. |
|
disconnect ( ) : void |
Closes the database connection. |
|
dropColumn ( string $tableName, string $columnName ) : void |
Drops the specified column. |
|
dropDatabase ( string $name ) : void |
Drops the specified database. |
|
dropForeignKey ( string $tableName, string[] $columns, string | null $constraint = null ) : void |
Drops the specified foreign key from a database table. |
|
dropIndex ( string $tableName, mixed $columns ) : void |
Drops the specified index from a database table. |
|
dropIndexByName ( string $tableName, string $indexName ) : void |
Drops the index specified by name from a database table. |
|
dropTable ( string $tableName ) : void |
Drops the specified database table. |
|
endCommandTimer ( ) : void |
Stop timing the current command and write the elapsed time to the
output. |
|
execute ( string $sql ) : integer |
Executes a SQL statement and returns the number of affected rows. |
|
fetchAll ( string $sql ) : array |
Executes a query and returns an array of rows. |
|
fetchRow ( string $sql ) : array |
Executes a query and returns only one row as an array. |
|
getAdapterType ( ) : string |
Returns the adapter type. |
|
getColumnTypes ( ) : array |
Returns an array of the supported Phinx column types. |
|
getColumns ( string $tableName ) : Phinx\Db\Table\Column[] |
Returns table columns |
|
getCommandStartTime ( ) : integer |
Gets the command start time |
|
getConnection ( ) : PDO |
Gets the database connection |
|
getOption ( string $name ) : mixed |
Get a single adapter option, or null if the option does not exist. |
|
getOptions ( ) : array |
Get all adapter options. |
|
getOutput ( ) : Symfony\Component\Console\Output\OutputInterface |
Gets the console output. |
|
getSqlType ( string $type, integer | null $limit = null ) : string |
Converts the Phinx logical type to the adapter's SQL type. |
|
getVersionLog ( ) : array |
Get all migration log entries, indexed by version number. |
|
getVersions ( ) : array |
Get all migrated version numbers. |
|
hasColumn ( string $tableName, string $columnName ) : boolean |
Checks to see if a column exists. |
|
hasDatabase ( string $name ) : boolean |
Checks to see if a database exists. |
|
hasForeignKey ( string $tableName, string[] $columns, string | null $constraint = null ) : boolean |
Checks to see if a foreign key exists. |
|
hasIndex ( string $tableName, mixed $columns ) : boolean |
Checks to see if an index exists. |
|
hasIndexByName ( string $tableName, string $indexName ) : boolean |
Checks to see if an index specified by name exists. |
|
hasOption ( string $name ) : boolean |
Check if an option has been set. |
|
hasSchemaTable ( ) : boolean |
Does the schema table exist? |
|
hasTable ( string $tableName ) : boolean |
Checks to see if a table exists. |
|
hasTransactions ( ) : boolean |
Does the adapter support transactions? |
|
insert ( Phinx\Db\Table $table, array $row ) : void |
Inserts data into a table. |
|
isValidColumnType ( Phinx\Db\Table\Column $column ) : boolean |
Checks that the given column is of a supported type. |
|
migrated ( Phinx\Migration\MigrationInterface $migration, string $direction, integer $startTime, integer $endTime ) : Phinx\Db\Adapter\AdapterInterface |
Records a migration being run. |
|
query ( string $sql ) : array |
Executes a SQL statement and returns the result as an array. |
|
quoteColumnName ( string $columnName ) : string |
Quotes a column name for use in a query. |
|
quoteTableName ( string $tableName ) : string |
Quotes a table name for use in a query. |
|
renameColumn ( string $tableName, string $columnName, string $newColumnName ) : void |
Renames the specified column. |
|
renameTable ( string $tableName, string $newName ) : void |
Renames the specified database table. |
|
rollbackTransaction ( ) : void |
Rollback a transaction. |
|
setCommandStartTime ( integer $time ) : Phinx\Db\Adapter\AdapterInterface |
Sets the command start time |
|
setOptions ( array $options ) : Phinx\Db\Adapter\AdapterInterface |
Set adapter configuration options. |
|
setOutput ( Symfony\Component\Console\Output\OutputInterface $output ) : Phinx\Db\Adapter\AdapterInterface |
Sets the console output. |
|
startCommandTimer ( ) : void |
Start timing a command. |
|
writeCommand ( string $command, array $args = [] ) : void |
Write a Phinx command to the output. |
|