src/DataStore/src/TableGateway/TableManagerMysql.php
protected function createForeignKeyConstraint(array $constraintOptions, string $fieldName, string $tableName)
    {
        if (is_string($constraintOptions['name'] ?? null)) {
            $constraintName = $constraintOptions;
        } else {
            $constraintName = "ForeignKey_{$tableName}_{$fieldName}";
        }

        if (empty($constraintOptions['referenceTable'])) {
            throw new InvalidArgumentException("Missing option 'referenceTable' for foreign key constraint");
        }

        if (empty($constraintOptions['referenceColumn'])) {
            throw new InvalidArgumentException("Missing option 'referenceColumn' for foreign key constraint");
        }

        return new Constraint\ForeignKey(
            $constraintName,
            [$fieldName],
            $constraintOptions['referenceTable'],
            $constraintOptions['referenceColumn'],
            $constraintOptions['onDeleteRule'] ?? null,
            $constraintOptions['onUpdateRule'] ?? null
        );
    }
protected function createForeignKeyConstraint(array $constraintOptions, string $fieldName, string $tableName)
    {
        if (is_string($constraintOptions['name'] ?? null)) {
            $constraintName = $constraintOptions;
        } else {
            $constraintName = "ForeignKey_{$tableName}_{$fieldName}";
        }

        if (empty($constraintOptions['referenceTable'])) {
            throw new InvalidArgumentException("Missing option 'referenceTable' for foreign key constraint");
        }

        if (empty($constraintOptions['referenceColumn'])) {
            throw new InvalidArgumentException("Missing option 'referenceColumn' for foreign key constraint");
        }

        return new Constraint\ForeignKey(
            $constraintName,
            [$fieldName],
            $constraintOptions['referenceTable'],
            $constraintOptions['referenceColumn'],
            $constraintOptions['onDeleteRule'] ?? null,
            $constraintOptions['onUpdateRule'] ?? null
        );
    }
protected function createForeignKeyConstraint ( array $ constraintOptions , string $ fieldName , string $ tableName ) { if ( is_string ( $ constraintOptions [ 'name' ] ?? null ) ) { $ constraintName = $ constraintOptions ; } else { $ constraintName = "ForeignKey_{$tableName}_{$fieldName}" ; } if ( empty ( $ constraintOptions [ 'referenceTable' ] ) ) { throw new InvalidArgumentException ( "Missing option 'referenceTable' for foreign key constraint" ) ; } if ( empty ( $ constraintOptions [ 'referenceColumn' ] ) ) { throw new InvalidArgumentException ( "Missing option 'referenceColumn' for foreign key constraint" ) ; } return new Constraint \ ForeignKey ( $ constraintName , [ $ fieldName ] , $ constraintOptions [ 'referenceTable' ] , $ constraintOptions [ 'referenceColumn' ] , $ constraintOptions [ 'onDeleteRule' ] ?? null , $ constraintOptions [ 'onUpdateRule' ] ?? null ) ; }
Create and return instance of Constraint\ForeignKey

@param array $constraintOptions
@param string $fieldName
@param string $tableName
@return Constraint\ForeignKey
Create and return instance of Constraint \ ForeignKey