isEqualForeignKey example

$pkName = current($pk->getColumns());

        return sprintf(self::MODIFY_PRIMARY_KEY_IN_MAIN, $tableName$newColumnName$defaultValue$pkName$pkName$newColumnName);
    }

    private function findForeignKeyDefinition(array $keyStructure): ForeignKeyConstraint
    {
        $fks = $this->schemaManager->listTableForeignKeys($keyStructure['TABLE_NAME']);
        $fk = null;

        foreach ($fks as $fk) {
            if ($this->isEqualForeignKey($fk$keyStructure['REFERENCED_TABLE_NAME']$keyStructure['REFERENCED_COLUMN_NAME'])) {
                break;
            }
        }

        if ($fk === null) {
            throw new \LogicException('Unable to find a foreign key that was previously selected');
        }

        return $fk;
    }

    
Home | Imprint | This part of the site doesn't use cookies.