File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,10 @@ public function getInnerForm()
49
49
50
50
public function getValue ()
51
51
{
52
- return $ this ->exportValue ();
52
+ if (!$ this ->value instanceof Form)
53
+ return null ;
54
+
55
+ return Hstore::make ($ this ->value ->export ());
53
56
}
54
57
55
58
/**
@@ -103,7 +106,9 @@ public function exportValue()
103
106
if (!$ this ->value instanceof Form)
104
107
return null ;
105
108
106
- return Hstore::make ($ this ->value ->export ());
109
+ return !$ this ->value ->getErrors ()
110
+ ? $ this ->value ->export ()
111
+ : null ;
107
112
}
108
113
109
114
/**
Original file line number Diff line number Diff line change 1
- 2012-08-08 Artem A. Naumenko
1
+ 2012-08-10 Alexey S. Denisov
2
+
3
+ * core/Form/Primitives/PrimitiveHstore.class.php:
4
+ PrimitiveHstore exportValue now return array|null instead Hstore object
2
5
3
- * core/DB/NoSQL/RedisNoSQL.class.php
6
+ 2012-08-08 Artem A. Naumenko
4
7
5
- added campability with old version of redis servers
8
+ * core/DB/NoSQL/RedisNoSQL.class.php:
9
+ added campability with old version of redis servers
6
10
7
11
2012-07-20 Alexey S. Denisov
8
12
Original file line number Diff line number Diff line change 1
1
<?php
2
- /* $Id$ */
3
-
4
2
final class PrimitiveHstoreTest extends TestCase
5
3
{
6
4
protected static $ scope =
@@ -47,6 +45,10 @@ public function testImport()
47
45
$ hstore ->getList (),
48
46
self ::$ scope ['properties ' ]
49
47
);
48
+ $ this ->assertEquals (
49
+ $ prm ->exportValue (),
50
+ self ::$ scope ['properties ' ]
51
+ );
50
52
51
53
try {
52
54
$ hstore ->get ('NotFound ' );
@@ -81,6 +83,8 @@ public function testInvalidImport()
81
83
)
82
84
);
83
85
86
+ $ this ->assertNull ($ prm ->exportValue ());
87
+
84
88
$ prm ->clean ();
85
89
}
86
90
You can’t perform that action at this time.
0 commit comments