Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
C++-SCA-Next
-
None
-
None
-
PHP, WIn32
Description
This is perhaps a variation on Tuscany-1225. Problem is that when using CopyHelper to clone a DataObject, properties which are set to null remain unset in the destination DataObject.
Example:
SCHEMA:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="PersonNamespace"
xmlns:AuthorNS="PersonNamespace">
<complexType name="personType">
<sequence>
<element name="name" type="string"/>
<element name="dob" type="string"/>
<element name="pob" type="string"/>
</sequence>
</complexType>
</schema>
logic:
$xmldas = SDO_DAS_XML::create('person.xsd');
$person = $xmldas->createDataObject('PersonNamespace','personType');
$person->name = "William Shakespeare'";
$person->dob = null;
$person->pob = null;
$person2 = clone($person);
After the clone the php $person looks like:
object(SDO_DataObject)#3 (3)
{name=>"William Shakespeare'"; dob=>NULL; pob=>NULL}but $person2 is:
object(SDO_DataObject)#4 (3)
(I can't show you the Tuscany print of the DO, because it causes an AccessViolation )
Problem is perhaps that transferitem() doesn't consider nulls