public function compareForeignKeys($caseInsensitive = false)
    {
        $fkDifferences = 0;
        $fromTableFks = $this->getFromTable()->getForeignKeys();
        $toTableFks = $this->getToTable()->getForeignKeys();

        foreach ($fromTableFks as $fromTableFkPos => $fromTableFk) {
            foreach ($toTableFks as $toTableFkPos => $toTableFk) {
                if (PropelForeignKeyComparator::computeDiff($fromTableFk, $toTableFk, $caseInsensitive) === false) {
                    unset($fromTableFks[$fromTableFkPos]);
                    unset($toTableFks[$toTableFkPos]);
                } else {
                    $test = $caseInsensitive ?
                        strtolower($fromTableFk->getName()) == strtolower($toTableFk->getName()) :
                        $fromTableFk->getName() == $toTableFk->getName();
                    if ($test) {
                        // same name, but different columns
                        $this->tableDiff->addModifiedFk($fromTableFk->getName(), $fromTableFk, $toTableFk);
                        unset($fromTableFks[$fromTableFkPos]);
                        unset($toTableFks[$toTableFkPos]);
                        $fkDifferences++;
                    }
                }
            }
        }

        foreach ($fromTableFks as $fromTableFkPos => $fromTableFk) {
            if (!$fromTableFk->isSkipSql() && !in_array($fromTableFk, $toTableFks)) {
                $this->tableDiff->addRemovedFk($fromTableFk->getName(), $fromTableFk);
                $fkDifferences++;
            }
        }

        foreach ($toTableFks as $toTableFkPos => $toTableFk) {
            if (!$toTableFk->isSkipSql() && !in_array($toTableFk, $fromTableFks)) {
                $this->tableDiff->addAddedFk($toTableFk->getName(), $toTableFk);
                $fkDifferences++;
            }
        }

        return $fkDifferences;
    }
public function compareForeignKeys($caseInsensitive = false)
    {
        $fkDifferences = 0;
        $fromTableFks = $this->getFromTable()->getForeignKeys();
        $toTableFks = $this->getToTable()->getForeignKeys();

        foreach ($fromTableFks as $fromTableFkPos => $fromTableFk) {
            foreach ($toTableFks as $toTableFkPos => $toTableFk) {
                if (PropelForeignKeyComparator::computeDiff($fromTableFk, $toTableFk, $caseInsensitive) === false) {
                    unset($fromTableFks[$fromTableFkPos]);
                    unset($toTableFks[$toTableFkPos]);
                } else {
                    $test = $caseInsensitive ?
                        strtolower($fromTableFk->getName()) == strtolower($toTableFk->getName()) :
                        $fromTableFk->getName() == $toTableFk->getName();
                    if ($test) {
                        // same name, but different columns
                        $this->tableDiff->addModifiedFk($fromTableFk->getName(), $fromTableFk, $toTableFk);
                        unset($fromTableFks[$fromTableFkPos]);
                        unset($toTableFks[$toTableFkPos]);
                        $fkDifferences++;
                    }
                }
            }
        }

        foreach ($fromTableFks as $fromTableFkPos => $fromTableFk) {
            if (!$fromTableFk->isSkipSql() && !in_array($fromTableFk, $toTableFks)) {
                $this->tableDiff->addRemovedFk($fromTableFk->getName(), $fromTableFk);
                $fkDifferences++;
            }
        }

        foreach ($toTableFks as $toTableFkPos => $toTableFk) {
            if (!$toTableFk->isSkipSql() && !in_array($toTableFk, $fromTableFks)) {
                $this->tableDiff->addAddedFk($toTableFk->getName(), $toTableFk);
                $fkDifferences++;
            }
        }

        return $fkDifferences;
    }
public function compareForeignKeys ( $ caseInsensitive = false ) { $ fkDifferences = 0 ; $ fromTableFks = $ this -> getFromTable ( ) -> getForeignKeys ( ) ; $ toTableFks = $ this -> getToTable ( ) -> getForeignKeys ( ) ; foreach ( $ fromTableFks as $ fromTableFkPos => $ fromTableFk ) { foreach ( $ toTableFks as $ toTableFkPos => $ toTableFk ) { if ( PropelForeignKeyComparator :: computeDiff ( $ fromTableFk , $ toTableFk , $ caseInsensitive ) === false ) { unset ( $ fromTableFks [ $ fromTableFkPos ] ) ; unset ( $ toTableFks [ $ toTableFkPos ] ) ; } else { $ test = $ caseInsensitive ? strtolower ( $ fromTableFk -> getName ( ) ) == strtolower ( $ toTableFk -> getName ( ) ) : $ fromTableFk -> getName ( ) == $ toTableFk -> getName ( ) ; if ( $ test ) { // same name, but different columns $ this -> tableDiff -> addModifiedFk ( $ fromTableFk -> getName ( ) , $ fromTableFk , $ toTableFk ) ; unset ( $ fromTableFks [ $ fromTableFkPos ] ) ; unset ( $ toTableFks [ $ toTableFkPos ] ) ; $ fkDifferences ++ ; } } } } foreach ( $ fromTableFks as $ fromTableFkPos => $ fromTableFk ) { if ( ! $ fromTableFk -> isSkipSql ( ) && ! in_array ( $ fromTableFk , $ toTableFks ) ) { $ this -> tableDiff -> addRemovedFk ( $ fromTableFk -> getName ( ) , $ fromTableFk ) ; $ fkDifferences ++ ; } } foreach ( $ toTableFks as $ toTableFkPos => $ toTableFk ) { if ( ! $ toTableFk -> isSkipSql ( ) && ! in_array ( $ toTableFk , $ fromTableFks ) ) { $ this -> tableDiff -> addAddedFk ( $ toTableFk -> getName ( ) , $ toTableFk ) ; $ fkDifferences ++ ; } } return $ fkDifferences ; }
Compare the foreign keys of the fromTable and the toTable,
and modifies the inner tableDiff if necessary.
Returns the number of differences.

@param boolean $caseInsensitive Whether the comparison is case insensitive.
False by default.

@return integer The number of foreign key differences
Compare the foreign keys of the fromTable and the toTable and modifies the inner tableDiff if necessary . Returns the number of differences .