/var/www/vhosts/ihelp.ro/_OLD/vendor/robmorgan/phinx/src/Phinx/Db/Adapter
NameSizeModeActions
AbstractAdapter.php103580644editdlrm
AdapterFactory.php42950644editdlrm
AdapterInterface.php133330644editdlrm
AdapterWrapper.php93770644editdlrm
DirectActionInterface.php41240644editdlrm
MysqlAdapter.php445580644editdlrm
PdoAdapter.php293510644editdlrm
PostgresAdapter.php459150644editdlrm
ProxyAdapter.php36000644editdlrm
SQLiteAdapter.php517860644editdlrm
SqlServerAdapter.php417560644editdlrm
TablePrefixAdapter.php150790644editdlrm
TimedOutputAdapter.php123690644editdlrm
UnsupportedColumnTypeException.php3930644editdlrm
WrapperInterface.php9590644editdlrm
Edit: /var/www/vhosts/ihelp.ro/_OLD/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/ProxyAdapter.php (3600B)
*/ class ProxyAdapter extends AdapterWrapper { /** * @var \Phinx\Db\Action\Action[] */ protected $commands = []; /** * @inheritDoc */ public function getAdapterType() { return 'ProxyAdapter'; } /** * @inheritDoc */ public function createTable(Table $table, array $columns = [], array $indexes = []) { $this->commands[] = new CreateTable($table); } /** * @inheritDoc */ public function executeActions(Table $table, array $actions) { $this->commands = array_merge($this->commands, $actions); } /** * Gets an array of the recorded commands in reverse. * * @throws \Phinx\Migration\IrreversibleMigrationException if a command cannot be reversed. * * @return \Phinx\Db\Plan\Intent */ public function getInvertedCommands() { $inverted = new Intent(); foreach (array_reverse($this->commands) as $command) { switch (true) { case $command instanceof CreateTable: $inverted->addAction(new DropTable($command->getTable())); break; case $command instanceof RenameTable: $inverted->addAction(new RenameTable(new Table($command->getNewName()), $command->getTable()->getName())); break; case $command instanceof AddColumn: $inverted->addAction(new RemoveColumn($command->getTable(), $command->getColumn())); break; case $command instanceof RenameColumn: $column = clone $command->getColumn(); $name = $column->getName(); $column->setName($command->getNewName()); $inverted->addAction(new RenameColumn($command->getTable(), $column, $name)); break; case $command instanceof AddIndex: $inverted->addAction(new DropIndex($command->getTable(), $command->getIndex())); break; case $command instanceof AddForeignKey: $inverted->addAction(new DropForeignKey($command->getTable(), $command->getForeignKey())); break; default: throw new IrreversibleMigrationException(sprintf( 'Cannot reverse a "%s" command', get_class($command) )); } } return $inverted; } /** * Execute the recorded commands in reverse. * * @return void */ public function executeInvertedCommands() { $plan = new Plan($this->getInvertedCommands()); $plan->executeInverse($this->getAdapter()); } }