Login   Register  
PHP Classes
elePHPant
Icontem

File: WsdlToPhpStructAttribute.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of MikaŽl DELSOL  >  WSDL To PHP  >  WsdlToPhpStructAttribute.php  
File: WsdlToPhpStructAttribute.php
Role: Class source
Content type: text/plain
Description: Class source
Class: WSDL To PHP
Generate classes to send SOAP requests from a WSDL
Author: By
Last change: [UPDATE] PSR-2 standards for generator files and generated files
[UPDATE] enhancements and refactoring

Closes https://github.com/mikaelcom/WsdlToPhp/issues/25.

Simplification of the instantiation of Service objects in the
generated sample file by removing the SoapClient options parameter. By
default, the cache_wsdl is disabled, the wsdl_url is set with the WSDL
url used to generate the package and trace is set with true. The
VALUE_WSDL_URL constant has been added to the generated WsdlClass
defined with the WSDL url used to generate the package.

Remove trailing ?> in generator files/classes.

Add WsdlToPhpGenerator::getWsdl($_index) method to get any WSDL at any
position.

Enhance generated sample file with explanation about the optional
parameter allowing to override the SoapClient Options. Remove the $wsdl
parareter previously used to instantiate each Service object.

Avoid Struct object to reset SoapClient when it is instantiated when
calling the parent constructor.
[UPDATE] several updates based on Github updated files
[UPDATE] code review and enhancements

Override WsdlToPhpModel::getOwner() method in inherited classes when it makes sense so the caller knows the exact return type

Enhanced attribute type definition by avoiding that the attribute type is the type of the class it belongs to
[UPDATE] minor generated setter improvement

When a struct contains properties with invalid names (such as "my-property"), the setter is named setMy_property but the property which is set is $this->{'my-property'} so when the object is sent to the SoapClient, this is the right value that is used. When we use var_export, then the property is exported as "my-property" but the __set_state() method, called in the WsdlClass when loading the exported object, only considers valid attribute names to call the setter. To fix this issue, we then also set the valid attribute name $this->my_property in the setMy_property() method, the setter. So the setter method, setMy_property() is called accordingly to the attribute name when the __set_state() method is called and everything goes well!
[UPDATE] global php doc harmonisation and minor improvement
[UPDATE] minor updates

Minor update to avoid PHP warning about empty XML content when calling the method on a DOMDocument property type

Php doc block comment update
Date: 7 months ago
Size: 13,153 bytes

You need to be a registered user and login to get this file.

1,302,226 PHP developers registered to the PHP Classes site.
Be One of Us!

Login Immediately with your account on:

Facebook ConnectGmail or other Google AccountHotmail or Microsoft Windows LiveStackOverflowGitHubYahoo