LazyRecord\SqlBuilder\MysqlBuilder::buildForeignKeyConstraint PHP Method

buildForeignKeyConstraint() public method

Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-foreign-key-constraints.html for correct foreign key definition.
public buildForeignKeyConstraint ( Relationship $rel )
$rel LazyRecord\Schema\Relationship\Relationship
    public function buildForeignKeyConstraint(Relationship $rel)
    {
        $schemaClass = $rel['foreign_schema'];
        $fSchema = new $schemaClass();
        $constraint = new Constraint();
        $constraint->foreignKey($rel['self_column']);
        $references = $constraint->references($fSchema->getTable(), (array) $rel['foreign_column']);
        if ($act = $rel->onUpdate) {
            $references->onUpdate($act);
        }
        if ($act = $rel->onDelete) {
            $references->onDelete($act);
        }
        return $constraint;
    }