getForeignColumns example

$source = self::ASSOCIATION_PROPERTY;

        if (!\array_key_exists($foreignKey->getForeignTableName()$this->tableMapping)) {
            return '';
        }

        $referenceTable = $this->tableMapping[$foreignKey->getForeignTableName()];
        $className = $this->getClassNameOfTableName($foreignKey->getForeignTableName());
        $namespace = $referenceTable['namespace'] . '\\' . $referenceTable['class'];

        $localColumn = $foreignKey->getLocalColumns();
        $foreignColumn = $foreignKey->getForeignColumns();

        $source = str_replace('%foreignClass%', $namespace$source);
        $source = str_replace('%localColumn%', $localColumn[0]$source);
        $source = str_replace('%foreignColumn%', $foreignColumn[0]$source);
        $source = str_replace('%property%', lcfirst($className)$source);

        return $source;
    }

    /** * Creates the source code for the custom constructor, which initializes all * not-null properties with their respective default value. * * @param \Doctrine\DBAL\Schema\Table $table * * @return string */
private function implodeColumns(array $columns): string
    {
        return implode(',', array_map(fn (string $column): string => '`' . $column . '`', $columns));
    }

    private function isEqualForeignKey(ForeignKeyConstraint $constraint, string $foreignTable, array $foreignFieldNames): bool
    {
        if ($constraint->getForeignTableName() !== $foreignTable) {
            return false;
        }

        return \count(array_diff($constraint->getForeignColumns()$foreignFieldNames)) === 0;
    }

    private function hydrateForeignKeyData(array $data, string $keyColumnName): array
    {
        $hydratedData = $this->mapHydrateForeignKeyData($data);

        return $this->filterHydrateForeignKeyData($hydratedData$keyColumnName);
    }

    private function mapHydrateForeignKeyData(array $data): array
    {
        
Home | Imprint | This part of the site doesn't use cookies.