Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions core/Form/Primitives/PrimitiveHstore.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ public function getInnerForm()

public function getValue()
{
return $this->exportValue();
if (!$this->value instanceof Form)
return null;

return Hstore::make($this->value->export());
}

/**
Expand Down Expand Up @@ -103,7 +106,9 @@ public function exportValue()
if (!$this->value instanceof Form)
return null;

return Hstore::make($this->value->export());
return !$this->value->getErrors()
? $this->value->export()
: null;
}

/**
Expand Down
10 changes: 7 additions & 3 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
2012-08-08 Artem A. Naumenko
2012-08-10 Alexey S. Denisov

* core/Form/Primitives/PrimitiveHstore.class.php:
PrimitiveHstore exportValue now return array|null instead Hstore object

* core/DB/NoSQL/RedisNoSQL.class.php
2012-08-08 Artem A. Naumenko

added campability with old version of redis servers
* core/DB/NoSQL/RedisNoSQL.class.php:
added campability with old version of redis servers

2012-07-20 Alexey S. Denisov

Expand Down
8 changes: 6 additions & 2 deletions test/core/PrimitiveHstoreTest.class.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php
/* $Id$ */

final class PrimitiveHstoreTest extends TestCase
{
protected static $scope =
Expand Down Expand Up @@ -47,6 +45,10 @@ public function testImport()
$hstore->getList(),
self::$scope['properties']
);
$this->assertEquals(
$prm->exportValue(),
self::$scope['properties']
);

try {
$hstore->get('NotFound');
Expand Down Expand Up @@ -81,6 +83,8 @@ public function testInvalidImport()
)
);

$this->assertNull($prm->exportValue());

$prm->clean();
}

Expand Down