Changeset 110 for trunk/XJConf

Show
Ignore:
Timestamp:
10/19/07 00:00:36 (1 year ago)
Author:
mikey
Message:

added a fourth way of adding children, this time via the keyAttribute attribute
increased version number to 0.2.1-dev

Files:

Legend:

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

    r103 r110  
    120120                if ($class->hasMethod($child->getSetterMethod()) == true) { 
    121121                    $method = $class->getMethod($child->getSetterMethod()); 
     122                } elseif ($class->hasMethod($child->getKey()) == true) { 
     123                    $method = $class->getMethod($child->getKey()); 
    122124                } elseif ($class->hasMethod('__set') == true) { 
    123125                    $method = $class->getMethod('__set'); 
     
    129131                    } 
    130132                     
    131                     throw new ValueConversionException('Could not add attribute "' . $child->getKey() . '" to "' . $this->getType() . '" using "' . $child->getSetterMethod() . '()" or "__set()" or public property "' . $child->getKey() . '", no such method defined.'); 
     133                    throw new ValueConversionException('Could not add child "' . $child->getKey() . '" to "' . $this->getType() . '" using "' . $child->getSetterMethod() . '()" or "' . $child->getKey() . '" or "__set()" or public property "' . $child->getKey() . '", no such method defined.'); 
    132134                } else { 
    133                     throw new ValueConversionException('Could not add attribute "' . $child->getKey() . '" to "' . $this->getType() . '" using "' . $child->getSetterMethod() . '()" or "__set()" or public property "' . $child->getKey() . '", no such method defined.'); 
     135                    throw new ValueConversionException('Could not add child "' . $child->getKey() . '" to "' . $this->getType() . '" using "' . $child->getSetterMethod() . '()" or "' . $child->getKey() . '" or "__set()" or public property "' . $child->getKey() . '", no such method defined.'); 
    134136                } 
    135137                 
     
    140142                } 
    141143            } catch (ReflectionException $re) { 
    142                 throw new ValueConversionException('Could not add child "' . $child->getKey() . '" to "' . $this->getType() . '" using "' . $child->getSetterMethod() . '()" or "__set()" or public property "' . $child->getKey() . '", exception message: "' . $re->getMessage() . '".'); 
     144                throw new ValueConversionException('Could not add child "' . $child->getKey() . '" to "' . $this->getType() . '" using "' . $child->getSetterMethod() . '()" or "' . $child->getKey() . '" or "__set()" or public property "' . $child->getKey() . '", exception message: "' . $re->getMessage() . '".'); 
    143145            } 
    144146        }