File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ class ValueConverter
31
31
* - if the given $value is a Node object, type will be REFERENCE, unless
32
32
* $weak is set to true which results in WEAKREFERENCE
33
33
* - if the given $value is a DateTime object, the type will be DATE.
34
+ * - if the $value is an empty array, the type is arbitrarily set to STRING
35
+ * - if the $value is a non-empty array, the type of its first element is
36
+ * chosen.
34
37
*
35
38
* Note that string is converted to date exactly if it matches the jcr
36
39
* formatting spec for dates (sYYYY-MM-DDThh:mm:ss.sssTZD) according to
@@ -46,6 +49,15 @@ class ValueConverter
46
49
*/
47
50
public function determineType ($ value , $ weak = false )
48
51
{
52
+ if (is_array ($ value )) {
53
+ if (0 === count ($ value )) {
54
+ // there is no value to determine the type on. we arbitrarily
55
+ // chose string, which is what jackrabbit does as well.
56
+ return PropertyType::STRING ;
57
+ }
58
+ $ value = reset ($ value );
59
+ }
60
+
49
61
return PropertyType::determineType ($ value , $ weak );
50
62
}
51
63
You can’t perform that action at this time.
0 commit comments