src/Xethron/MigrationsGenerator/Generators/ForeignKeyGenerator.php
public function generate($table, $schema, $ignoreForeignKeyNames)
	{
		$this->table = $table;
		$fields = [];

		$foreignKeys = $schema->listTableForeignKeys($table);

		if ( empty( $foreignKeys ) ) return array();

		foreach ( $foreignKeys as $foreignKey ) {
			$fields[] = [
				'name' => $this->getName($foreignKey, $ignoreForeignKeyNames),
				'field' => $foreignKey->getLocalColumns()[0],
				'references' => $foreignKey->getForeignColumns()[0],
				'on' => $foreignKey->getForeignTableName(),
				'onUpdate' => $foreignKey->hasOption('onUpdate') ? $foreignKey->getOption('onUpdate') : 'RESTRICT',
				'onDelete' => $foreignKey->hasOption('onDelete') ? $foreignKey->getOption('onDelete') : 'RESTRICT',
			];
		}
		return $fields;
	}
public function generate($table, $schema, $ignoreForeignKeyNames)
	{
		$this->table = $table;
		$fields = [];

		$foreignKeys = $schema->listTableForeignKeys($table);

		if ( empty( $foreignKeys ) ) return array();

		foreach ( $foreignKeys as $foreignKey ) {
			$fields[] = [
				'name' => $this->getName($foreignKey, $ignoreForeignKeyNames),
				'field' => $foreignKey->getLocalColumns()[0],
				'references' => $foreignKey->getForeignColumns()[0],
				'on' => $foreignKey->getForeignTableName(),
				'onUpdate' => $foreignKey->hasOption('onUpdate') ? $foreignKey->getOption('onUpdate') : 'RESTRICT',
				'onDelete' => $foreignKey->hasOption('onDelete') ? $foreignKey->getOption('onDelete') : 'RESTRICT',
			];
		}
		return $fields;
	}
public function generate ( $ table , $ schema , $ ignoreForeignKeyNames ) { $ this -> table = $ table ; $ fields = [ ] ; $ foreignKeys = $ schema -> listTableForeignKeys ( $ table ) ; if ( empty ( $ foreignKeys ) ) return array ( ) ; foreach ( $ foreignKeys as $ foreignKey ) { $ fields [ ] = [ 'name' => $ this -> getName ( $ foreignKey , $ ignoreForeignKeyNames ) , 'field' => $ foreignKey -> getLocalColumns ( ) [ 0 ] , 'references' => $ foreignKey -> getForeignColumns ( ) [ 0 ] , 'on' => $ foreignKey -> getForeignTableName ( ) , 'onUpdate' => $ foreignKey -> hasOption ( 'onUpdate' ) ? $ foreignKey -> getOption ( 'onUpdate' ) : 'RESTRICT' , 'onDelete' => $ foreignKey -> hasOption ( 'onDelete' ) ? $ foreignKey -> getOption ( 'onDelete' ) : 'RESTRICT' , ] ; } return $ fields ; }
Get array of foreign keys

@param string                                      $table Table Name
@param \Doctrine\DBAL\Schema\AbstractSchemaManager $schema
@param                                             $ignoreForeignKeyNames

@return array
Get array of foreign keys