/** * Creates a foreign index replacement, which has quoted column names. * * @param ForeignKeyConstraint $fk * * @return ForeignKeyConstraint */ private function createForeignKeyReplacement(ForeignKeyConstraint $fk) { return new ForeignKeyConstraint($this->quoteIdentifiers($fk->getLocalColumns()), $this->platform->quoteIdentifier($fk->getForeignTableName()), $this->quoteIdentifiers($fk->getForeignColumns()), $this->platform->quoteIdentifier($fk->getName()), $fk->getOptions()); }
/** * {@inheritDoc} */ public function getForeignKeyDeclarationSQL(ForeignKeyConstraint $foreignKey) { return parent::getForeignKeyDeclarationSQL(new ForeignKeyConstraint($foreignKey->getQuotedLocalColumns($this), str_replace('.', '__', $foreignKey->getQuotedForeignTableName($this)), $foreignKey->getQuotedForeignColumns($this), $foreignKey->getName(), $foreignKey->getOptions())); }
/** * Accept a foreign key for a table * * @param Table $localTable a table object * @param ForeignKeyConstraint $fkConstraint a constraint object * * @return void */ public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) { if (!isset($this->schemaArray['tables'][$localTable->getName()]['constraint'])) { $this->schemaArray['tables'][$localTable->getName()]['constraint'] = array(); } $this->schemaArray['tables'][$localTable->getName()]['constraint'][] = array('name' => $fkConstraint->getName(), 'localcolumns' => $fkConstraint->getLocalColumns(), 'foreigntable' => $fkConstraint->getForeignTableName(), 'foreigncolumns' => $fkConstraint->getForeignColumns(), 'options' => $fkConstraint->getOptions()); }