Permalink
Browse files

MINOR Added handling of DataList return vars to use the same converte…

…r as dataobject sets
  • Loading branch information...
1 parent 1991f7a commit 9750232ebc9e1c8443955d300b7cd75ba83acbe6 Marcus Nyeholt committed Jun 14, 2012
Showing with 3 additions and 2 deletions.
  1. +1 −1 _config.php
  2. +1 −0 code/controllers/WebServiceController.php
  3. +1 −1 code/serialisers/DataObjectSetJsonConverter.php
View
@@ -1,7 +1,7 @@
<?php
-Director::addRules(20, array(
+Director::addRules(100, array(
'jsonservice/$Service/$Method' => 'WebServiceController',
'xmlservice/$Service/$Method' => 'WebServiceController',
));
@@ -49,6 +49,7 @@ public function init() {
$this->converters['json'] = array(
'DataObject' => new DataObjectJsonConverter(),
'DataObjectSet' => new DataObjectSetJsonConverter(),
+ 'DataList' => new DataObjectSetJsonConverter(),
'Array' => new ArrayJsonConverter(),
'ScalarItem' => new ScalarJsonConverter(),
'stdClass' => new ScalarJsonConverter(),
@@ -8,7 +8,7 @@
*/
class DataObjectSetJsonConverter {
- public function convert(DataObjectSet $set) {
+ public function convert($set) {
$ret = new stdClass();
$ret->items = array();
foreach ($set as $item) {

0 comments on commit 9750232

Please sign in to comment.