protected function castParameter($mappedClassName, $key, $value)
    {
        $parameter = $this->getSetterParameter($mappedClassName, $key);
        $parameterClass = $this->getParameterClass($parameter);
        if ($parameterClass) {
            $paramClassName = $parameterClass->getNamespaceName() . '\\' . $parameterClass->getName();
            if ($paramClassName === '\DateTime') {
                $value = new \DateTime($value);
            }
        }

        return $value;
    }
protected function castParameter($mappedClassName, $key, $value)
    {
        $parameter = $this->getSetterParameter($mappedClassName, $key);
        $parameterClass = $this->getParameterClass($parameter);
        if ($parameterClass) {
            $paramClassName = $parameterClass->getNamespaceName() . '\\' . $parameterClass->getName();
            if ($paramClassName === '\DateTime') {
                $value = new \DateTime($value);
            }
        }

        return $value;
    }
protected function castParameter ( $ mappedClassName , $ key , $ value ) { $ parameter = $ this -> getSetterParameter ( $ mappedClassName , $ key ) ; $ parameterClass = $ this -> getParameterClass ( $ parameter ) ; if ( $ parameterClass ) { $ paramClassName = $ parameterClass -> getNamespaceName ( ) . '\\' . $ parameterClass -> getName ( ) ; if ( $ paramClassName === '\DateTime' ) { $ value = new \ DateTime ( $ value ) ; } } return $ value ; }
Cast the value, if parameter is typehinted

@param string $mappedClassName Object class name
@param string $key             Attribute name
@param mixed  $value           Value

@return \DateTime
@throws \ReflectionException
@throws \ITMH\Soap\Exception\InvalidClassMappingException
@todo   Make extensible
Cast the value if parameter is typehinted