/** * {@inheritdoc} */ public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) { $this->output .= $this->createNodeRelation($fkConstraint->getLocalTableName() . ":col" . current($fkConstraint->getLocalColumns()) . ":se", $fkConstraint->getForeignTableName() . ":col" . current($fkConstraint->getForeignColumns()) . ":se", array('dir' => 'back', 'arrowtail' => 'dot', 'arrowhead' => 'normal')); }
/** * @param ForeignKeyConstraint $foreignKey * @param Table|string $table * * @return string */ public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table) { $columns = $foreignKey->getColumns(); $column = reset($columns); $column = $table->getColumn($column); $sql = array(); if ($column->hasCustomSchemaOption('definedIn') and $column->getCustomSchemaOption('definedIn') === 'link') { $sql = $this->_getCreateColumnSQL($foreignKey->getLocalTableName(), $column->getName(), $column->toArray()); } return $sql; }