Changeset 5118

Show
Ignore:
Timestamp:
10/21/08 20:52:26 (9 months ago)
Author:
jwage
Message:

[1.0, 1.1] fixes #1563

Location:
branches
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/1.0/lib/Doctrine/Import/Schema.php

    r5053 r5118  
    472472        // Array of the array keys to move to the parent, and the value to default the child definition to 
    473473        // after moving it. Will also populate the subclasses array for the inheritance parent 
    474         $moves = array('columns' => array()); 
     474        $moves = array('columns' => array(), 
     475                       'indexes' => array(), 
     476                       'attributes' => array(), 
     477                       'options' => array(), 
     478                       'checks' => array()); 
    475479         
    476480        foreach ($array as $className => $definition) { 
     
    479483                $parent = $this->_findBaseSuperClass($array, $definition['className']); 
    480484                foreach ($moves as $move => $resetValue) { 
    481                     $array[$parent][$move] = Doctrine_Lib::arrayDeepMerge($array[$parent][$move], $definition[$move]); 
    482                     $array[$definition['className']][$move] = $resetValue; 
     485                    if (isset($array[$parent][$move]) && isset($definition[$move])) { 
     486                        $array[$parent][$move] = Doctrine_Lib::arrayDeepMerge($array[$parent][$move], $definition[$move]); 
     487                        $array[$definition['className']][$move] = $resetValue; 
     488                    } 
    483489                } 
    484490 
  • branches/1.1/lib/Doctrine/Import/Schema.php

    r5053 r5118  
    472472        // Array of the array keys to move to the parent, and the value to default the child definition to 
    473473        // after moving it. Will also populate the subclasses array for the inheritance parent 
    474         $moves = array('columns' => array()); 
     474        $moves = array('columns' => array(), 
     475                       'indexes' => array(), 
     476                       'attributes' => array(), 
     477                       'options' => array(), 
     478                       'checks' => array()); 
    475479         
    476480        foreach ($array as $className => $definition) { 
     
    479483                $parent = $this->_findBaseSuperClass($array, $definition['className']); 
    480484                foreach ($moves as $move => $resetValue) { 
    481                     $array[$parent][$move] = Doctrine_Lib::arrayDeepMerge($array[$parent][$move], $definition[$move]); 
    482                     $array[$definition['className']][$move] = $resetValue; 
     485                    if (isset($array[$parent][$move]) && isset($definition[$move])) { 
     486                        $array[$parent][$move] = Doctrine_Lib::arrayDeepMerge($array[$parent][$move], $definition[$move]); 
     487                        $array[$definition['className']][$move] = $resetValue; 
     488                    } 
    483489                } 
    484490