added methods to SoapServerBuilder to add TypeConverterInterface and

TypeConverterCollection objects directly
This commit is contained in:
Christian Kerl 2011-09-29 13:47:42 +02:00
parent 642c50c051
commit 824919b537

View File

@ -13,6 +13,8 @@
namespace BeSimple\SoapServer;
use BeSimple\SoapCommon\Cache;
use BeSimple\SoapCommon\Converter\TypeConverterInterface;
use BeSimple\SoapCommon\Converter\TypeConverterCollection;
/**
* SoapServerBuilder provides a fluent interface to configure and create a SoapServer instance.
@ -257,6 +259,20 @@ class SoapServerBuilder
throw new \InvalidArgumentException('The handler has to be a class name or an object!');
}
public function withTypeConverter(TypeConverterInterface $converter)
{
$this->withTypeMapping($converter->getTypeNamespace(), $converter->getTypeName(), array($converter, 'convertXmlToPhp'), array($converter, 'convertPhpToXml'));
return $this;
}
public function withTypeConverters(TypeConverterCollection $converters, $merge = true)
{
$this->withTypemap($converters->getTypemap(), $merge);
return $this;
}
/**
* Adds a type mapping to the typemap.
*