public function foreignKey(string $foreignKeyName): ForeignKeyLocalColumnsDefiner
    {
        return new ForeignKeyLocalColumnsDefiner(function (
            array $localColumnNames,
            $referencedTable,
            array $referencedColumns,
            $onUpdateMode,
            $onDeleteMode
        ) use ($foreignKeyName) {
            $this->foreignKeys[] = new ForeignKey(
                $this->orm->getNamespace() . $foreignKeyName,
                $localColumnNames,
                $referencedTable,
                $referencedColumns,
                $onUpdateMode,
                $onDeleteMode
            );
        });
    }
public function foreignKey(string $foreignKeyName): ForeignKeyLocalColumnsDefiner
    {
        return new ForeignKeyLocalColumnsDefiner(function (
            array $localColumnNames,
            $referencedTable,
            array $referencedColumns,
            $onUpdateMode,
            $onDeleteMode
        ) use ($foreignKeyName) {
            $this->foreignKeys[] = new ForeignKey(
                $this->orm->getNamespace() . $foreignKeyName,
                $localColumnNames,
                $referencedTable,
                $referencedColumns,
                $onUpdateMode,
                $onDeleteMode
            );
        });
    }
public function foreignKey ( string $ foreignKeyName ) : ForeignKeyLocalColumnsDefiner { return new ForeignKeyLocalColumnsDefiner ( function ( array $ localColumnNames , $ referencedTable , array $ referencedColumns , $ onUpdateMode , $ onDeleteMode ) use ( $ foreignKeyName ) { $ this -> foreignKeys [ ] = new ForeignKey ( $ this -> orm -> getNamespace ( ) . $ foreignKeyName , $ localColumnNames , $ referencedTable , $ referencedColumns , $ onUpdateMode , $ onDeleteMode ) ; } ) ; }
Defines a foreign key.

@param string $foreignKeyName

@return ForeignKeyLocalColumnsDefiner
Defines a foreign key .