File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ class ValueConverter
3131 * - if the given $value is a Node object, type will be REFERENCE, unless
3232 * $weak is set to true which results in WEAKREFERENCE
3333 * - 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.
3437 *
3538 * Note that string is converted to date exactly if it matches the jcr
3639 * formatting spec for dates (sYYYY-MM-DDThh:mm:ss.sssTZD) according to
@@ -46,6 +49,15 @@ class ValueConverter
4649 */
4750 public function determineType ($ value , $ weak = false )
4851 {
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+
4961 return PropertyType::determineType ($ value , $ weak );
5062 }
5163
You can’t perform that action at this time.
0 commit comments