chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From richa...@apache.org
Subject svn commit: r1130920 - /chemistry/phpclient/trunk/lib/cmis_repository_wrapper.php
Date Fri, 03 Jun 2011 07:34:10 GMT
Author: richardm
Date: Fri Jun  3 07:34:10 2011
New Revision: 1130920

URL: http://svn.apache.org/viewvc?rev=1130920&view=rev
Log:
If multi valued property is retrieved -- present it as an array as per issue CMIS-378

Modified:
    chemistry/phpclient/trunk/lib/cmis_repository_wrapper.php

Modified: chemistry/phpclient/trunk/lib/cmis_repository_wrapper.php
URL: http://svn.apache.org/viewvc/chemistry/phpclient/trunk/lib/cmis_repository_wrapper.php?rev=1130920&r1=1130919&r2=1130920&view=diff
==============================================================================
--- chemistry/phpclient/trunk/lib/cmis_repository_wrapper.php (original)
+++ chemistry/phpclient/trunk/lib/cmis_repository_wrapper.php Fri Jun  3 07:34:10 2011
@@ -383,9 +383,17 @@ class CMISRepositoryWrapper
             if ($pn->attributes)
             {
                 $propDefId = $pn->attributes->getNamedItem("propertyDefinitionId");
+                // TODO: Maybe use ->length=0 to even detect null values
                 if (!is_null($propDefId) && $pn->getElementsByTagName("value")
&& $pn->getElementsByTagName("value")->item(0))
                 {
-                    $retval->properties[$propDefId->nodeValue] = $pn->getElementsByTagName("value")->item(0)->nodeValue;
+                	if ($pn->getElementsByTagName("value")->length > 1) {
+                		$retval->properties[$propDefId->nodeValue] = array();
+                		for ($idx=0;$idx < $pn->getElementsByTagName("value")->length;$idx++)
{
+                			$retval->properties[$propDefId->nodeValue][$idx] = $pn->getElementsByTagName("value")->item($idx)->nodeValue;
+                		}
+                	} else {
+                		$retval->properties[$propDefId->nodeValue] = $pn->getElementsByTagName("value")->item(0)->nodeValue;
+                	}
                 }
             }
         }



Mime
View raw message