Changeset 33

Show
Ignore:
Timestamp:
08/31/06 19:56:29 (2 years ago)
Author:
mikey
Message:

fix: used getName() instead of getKey(), last gives correct value for array key

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/XJConf/converters/ArrayValueConverter.php

    r25 r33  
    5555            // attribute has not been set and there is no 
    5656            // default value, skip the method call 
    57             if (null == $val) { 
     57            if (null === $val) { 
    5858                continue; 
    5959            } 
     
    8181         
    8282        foreach ($children as $child) { 
    83             $val = $child->getConvertedValue(); 
    84             // attribute has not been set and there is no 
    85             // default value, skip the method call 
    86             if (null == $val) { 
     83            if (null != $child->getContent()) { 
     84                $val = $child->getContent(); 
     85            } else { 
     86                $val = $child->getConvertedValue(); 
     87            } 
     88             
     89            if (null === $val) { 
    8790                continue; 
    8891            } 
    8992             
    90             $childDef = $child->getDefinition(); 
    91             if ($childDef->getName() == '__none') { 
     93            if ($child->getKey() === null || $child->getKey() == '__none' || strlen($child->getKey()) === 0) { 
    9294                $array[] = $val; 
    9395            } else { 
    94                 $array[$child->getName()] = $val; 
     96                $array[$child->getKey()] = $val; 
    9597            } 
    9698        }