public function compareIndices($caseInsensitive = false)
    {
        $indexDifferences = 0;
        $fromTableIndices = array_merge($this->getFromTable()->getIndices(), $this->getFromTable()->getUnices());
        $toTableIndices = array_merge($this->getToTable()->getIndices(), $this->getToTable()->getUnices());

        foreach ($toTableIndices as $toTableIndexPos => $toTableIndex) {
            foreach ($fromTableIndices as $fromTableIndexPos => $fromTableIndex) {
                if (PropelIndexComparator::computeDiff($fromTableIndex, $toTableIndex, $caseInsensitive) === false) {
                    unset($fromTableIndices[$fromTableIndexPos]);
                    unset($toTableIndices[$toTableIndexPos]);
                } else {
                    $test = $caseInsensitive ?
                        strtolower($fromTableIndex->getName()) == strtolower($toTableIndex->getName()) :
                        $fromTableIndex->getName() == $toTableIndex->getName();
                    if ($test) {
                        // same name, but different columns
                        $this->tableDiff->addModifiedIndex($fromTableIndex->getName(), $fromTableIndex, $toTableIndex);
                        unset($fromTableIndices[$fromTableIndexPos]);
                        unset($toTableIndices[$toTableIndexPos]);
                        $indexDifferences++;
                    }
                }
            }
        }

        foreach ($fromTableIndices as $fromTableIndexPos => $fromTableIndex) {
            $this->tableDiff->addRemovedIndex($fromTableIndex->getName(), $fromTableIndex);
            $indexDifferences++;
        }

        foreach ($toTableIndices as $toTableIndexPos => $toTableIndex) {
            $this->tableDiff->addAddedIndex($toTableIndex->getName(), $toTableIndex);
            $indexDifferences++;
        }

        return $indexDifferences;
    }
public function compareIndices($caseInsensitive = false)
    {
        $indexDifferences = 0;
        $fromTableIndices = array_merge($this->getFromTable()->getIndices(), $this->getFromTable()->getUnices());
        $toTableIndices = array_merge($this->getToTable()->getIndices(), $this->getToTable()->getUnices());

        foreach ($toTableIndices as $toTableIndexPos => $toTableIndex) {
            foreach ($fromTableIndices as $fromTableIndexPos => $fromTableIndex) {
                if (PropelIndexComparator::computeDiff($fromTableIndex, $toTableIndex, $caseInsensitive) === false) {
                    unset($fromTableIndices[$fromTableIndexPos]);
                    unset($toTableIndices[$toTableIndexPos]);
                } else {
                    $test = $caseInsensitive ?
                        strtolower($fromTableIndex->getName()) == strtolower($toTableIndex->getName()) :
                        $fromTableIndex->getName() == $toTableIndex->getName();
                    if ($test) {
                        // same name, but different columns
                        $this->tableDiff->addModifiedIndex($fromTableIndex->getName(), $fromTableIndex, $toTableIndex);
                        unset($fromTableIndices[$fromTableIndexPos]);
                        unset($toTableIndices[$toTableIndexPos]);
                        $indexDifferences++;
                    }
                }
            }
        }

        foreach ($fromTableIndices as $fromTableIndexPos => $fromTableIndex) {
            $this->tableDiff->addRemovedIndex($fromTableIndex->getName(), $fromTableIndex);
            $indexDifferences++;
        }

        foreach ($toTableIndices as $toTableIndexPos => $toTableIndex) {
            $this->tableDiff->addAddedIndex($toTableIndex->getName(), $toTableIndex);
            $indexDifferences++;
        }

        return $indexDifferences;
    }
public function compareIndices ( $ caseInsensitive = false ) { $ indexDifferences = 0 ; $ fromTableIndices = array_merge ( $ this -> getFromTable ( ) -> getIndices ( ) , $ this -> getFromTable ( ) -> getUnices ( ) ) ; $ toTableIndices = array_merge ( $ this -> getToTable ( ) -> getIndices ( ) , $ this -> getToTable ( ) -> getUnices ( ) ) ; foreach ( $ toTableIndices as $ toTableIndexPos => $ toTableIndex ) { foreach ( $ fromTableIndices as $ fromTableIndexPos => $ fromTableIndex ) { if ( PropelIndexComparator :: computeDiff ( $ fromTableIndex , $ toTableIndex , $ caseInsensitive ) === false ) { unset ( $ fromTableIndices [ $ fromTableIndexPos ] ) ; unset ( $ toTableIndices [ $ toTableIndexPos ] ) ; } else { $ test = $ caseInsensitive ? strtolower ( $ fromTableIndex -> getName ( ) ) == strtolower ( $ toTableIndex -> getName ( ) ) : $ fromTableIndex -> getName ( ) == $ toTableIndex -> getName ( ) ; if ( $ test ) { // same name, but different columns $ this -> tableDiff -> addModifiedIndex ( $ fromTableIndex -> getName ( ) , $ fromTableIndex , $ toTableIndex ) ; unset ( $ fromTableIndices [ $ fromTableIndexPos ] ) ; unset ( $ toTableIndices [ $ toTableIndexPos ] ) ; $ indexDifferences ++ ; } } } } foreach ( $ fromTableIndices as $ fromTableIndexPos => $ fromTableIndex ) { $ this -> tableDiff -> addRemovedIndex ( $ fromTableIndex -> getName ( ) , $ fromTableIndex ) ; $ indexDifferences ++ ; } foreach ( $ toTableIndices as $ toTableIndexPos => $ toTableIndex ) { $ this -> tableDiff -> addAddedIndex ( $ toTableIndex -> getName ( ) , $ toTableIndex ) ; $ indexDifferences ++ ; } return $ indexDifferences ; }
Compare the indices and unique indices 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 index differences
Compare the indices and unique indices of the fromTable and the toTable and modifies the inner tableDiff if necessary . Returns the number of differences .