[SoapClient] Added Classmap

This commit is contained in:
Francis Besset
2011-10-08 15:07:49 +02:00
parent 7be719ffc5
commit 29a388eb7d
2 changed files with 40 additions and 4 deletions

View File

@ -13,6 +13,7 @@
namespace BeSimple\SoapClient;
use BeSimple\SoapCommon\Cache;
use BeSimple\SoapCommon\Classmap;
use BeSimple\SoapCommon\Converter\TypeConverterCollection;
/**
@ -21,6 +22,7 @@ use BeSimple\SoapCommon\Converter\TypeConverterCollection;
class SoapClient
{
protected $wsdl;
protected $classmap;
protected $converters;
protected $soapClient;
@ -28,9 +30,10 @@ class SoapClient
* @param string $wsdl
* @param array $options
*/
public function __construct($wsdl, array $options = array(), TypeConverterCollection $converters = null)
public function __construct($wsdl, array $options = array(), Classmap $classmap = null, TypeConverterCollection $converters = null)
{
$this->wsdl = $wsdl;
$this->classmap = $classmap;
$this->converters = $converters;
$this->setOptions($options);
@ -163,10 +166,23 @@ class SoapClient
return array(
'cache_wsdl' => $this->options['cache_type'],
'trace' => $this->options['debug'],
'classmap' => $this->getClassmap(),
'typemap' => $this->getTypemap(),
);
}
/**
* @return array
*/
protected function getClassmap()
{
if (!$this->classmap) {
return array();
}
return $this->classmap->all();
}
/**
* @return array
*/