Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Zend_Soap_Wsdl_Strategy_Composite Class Reference
Inheritance diagram for Zend_Soap_Wsdl_Strategy_Composite:
Zend_Soap_Wsdl_Strategy_Interface

Public Member Functions

 __construct (array $typeMap=array(), $defaultStrategy="Zend_Soap_Wsdl_Strategy_DefaultComplexType")
 
 connectTypeToStrategy ($type, $strategy)
 
 getDefaultStrategy ()
 
 getStrategyOfType ($type)
 
 setContext (Zend_Soap_Wsdl $context)
 
 addComplexType ($type)
 

Protected Attributes

 $_typeMap = array()
 
 $_defaultStrategy
 
 $_context
 

Detailed Description

Definition at line 37 of file Composite.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( array  $typeMap = array(),
  $defaultStrategy = "Zend_Soap_Wsdl_Strategy_DefaultComplexType" 
)

Construct Composite WSDL Strategy.

Exceptions
Zend_Soap_Wsdl_Exception
Parameters
array$typeMap
string | Zend_Soap_Wsdl_Strategy_Interface$defaultStrategy

Definition at line 67 of file Composite.php.

68  {
69  foreach($typeMap AS $type => $strategy) {
70  $this->connectTypeToStrategy($type, $strategy);
71  }
72  $this->_defaultStrategy = $defaultStrategy;
73  }
connectTypeToStrategy($type, $strategy)
Definition: Composite.php:83
$type
Definition: item.phtml:13

Member Function Documentation

◆ addComplexType()

addComplexType (   $type)

Create a complex type based on a strategy

Exceptions
Zend_Soap_Wsdl_Exception
Parameters
string$type
Returns
string XSD type
See also
Zend_Soap_Wsdl_Exception

Implements Zend_Soap_Wsdl_Strategy_Interface.

Definition at line 172 of file Composite.php.

173  {
174  if(!($this->_context instanceof Zend_Soap_Wsdl) ) {
178  #require_once "Zend/Soap/Wsdl/Exception.php";
179  throw new Zend_Soap_Wsdl_Exception(
180  "Cannot add complex type '".$type."', no context is set for this composite strategy."
181  );
182  }
183 
184  $strategy = $this->getStrategyOfType($type);
185  $strategy->setContext($this->_context);
186  return $strategy->addComplexType($type);
187  }
$type
Definition: item.phtml:13

◆ connectTypeToStrategy()

connectTypeToStrategy (   $type,
  $strategy 
)

Connect a complex type to a given strategy.

Exceptions
Zend_Soap_Wsdl_Exception
Parameters
string$type
string | Zend_Soap_Wsdl_Strategy_Interface$strategy
Returns
Zend_Soap_Wsdl_Strategy_Composite
See also
Zend_Soap_Wsdl_Exception

Definition at line 83 of file Composite.php.

84  {
85  if(!is_string($type)) {
89  #require_once "Zend/Soap/Wsdl/Exception.php";
90  throw new Zend_Soap_Wsdl_Exception("Invalid type given to Composite Type Map.");
91  }
92  $this->_typeMap[$type] = $strategy;
93  return $this;
94  }
$type
Definition: item.phtml:13

◆ getDefaultStrategy()

getDefaultStrategy ( )

Return default strategy of this composite

Exceptions
Zend_Soap_Wsdl_Exception
Parameters
string$type
Returns
Zend_Soap_Wsdl_Strategy_Interface
See also
Zend_Soap_Wsdl_Exception

Definition at line 103 of file Composite.php.

104  {
105  $strategy = $this->_defaultStrategy;
106  if(is_string($strategy) && class_exists($strategy)) {
107  $strategy = new $strategy;
108  }
109  if( !($strategy instanceof Zend_Soap_Wsdl_Strategy_Interface) ) {
113  #require_once "Zend/Soap/Wsdl/Exception.php";
114  throw new Zend_Soap_Wsdl_Exception(
115  "Default Strategy for Complex Types is not a valid strategy object."
116  );
117  }
118  $this->_defaultStrategy = $strategy;
119  return $strategy;
120  }

◆ getStrategyOfType()

getStrategyOfType (   $type)

Return specific strategy or the default strategy of this type.

Exceptions
Zend_Soap_Wsdl_Exception
Parameters
string$type
Returns
Zend_Soap_Wsdl_Strategy_Interface
See also
Zend_Soap_Wsdl_Exception

Definition at line 129 of file Composite.php.

130  {
131  if(isset($this->_typeMap[$type])) {
132  $strategy = $this->_typeMap[$type];
133 
134  if(is_string($strategy) && class_exists($strategy)) {
135  $strategy = new $strategy();
136  }
137 
138  if( !($strategy instanceof Zend_Soap_Wsdl_Strategy_Interface) ) {
142  #require_once "Zend/Soap/Wsdl/Exception.php";
143  throw new Zend_Soap_Wsdl_Exception(
144  "Strategy for Complex Type '".$type."' is not a valid strategy object."
145  );
146  }
147  $this->_typeMap[$type] = $strategy;
148  } else {
149  $strategy = $this->getDefaultStrategy();
150  }
151  return $strategy;
152  }
$type
Definition: item.phtml:13

◆ setContext()

setContext ( Zend_Soap_Wsdl  $context)

Method accepts the current WSDL context file.

Parameters
Zend_Soap_Wsdl$context

Implements Zend_Soap_Wsdl_Strategy_Interface.

Definition at line 159 of file Composite.php.

160  {
161  $this->_context = $context;
162  return $this;
163  }

Field Documentation

◆ $_context

$_context
protected

Definition at line 58 of file Composite.php.

◆ $_defaultStrategy

$_defaultStrategy
protected

Definition at line 51 of file Composite.php.

◆ $_typeMap

$_typeMap = array()
protected

Definition at line 44 of file Composite.php.


The documentation for this class was generated from the following file: