Show
Ignore:
Timestamp:
04/07/08 16:38:19 (5 months ago)
Author:
ischommer
Message:

FEATURE Added getSearchQuery(), getObjectQuery(), getObjectsQuery(), getObjectRelationQuery() to RestfulServer?
FEATURE Added $totalSize to DataFormatter? to add useful output for pagination via "limit" and "offset" parameters
API CHANGE Removed RestfulServer?->search()
API CHANGE Changed output format for convertDataObjectSet() in XMLDataFormatter and JSONDataFormatter

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • modules/sapphire/branches/roa/api/JSONDataFormatter.php

    r55564 r57417  
    9191                        if($item->canView()) $jsonParts[] = $this->convertDataObject($item); 
    9292                } 
    93                 return "[\n" . implode(",\n", $jsonParts) . "\n]"; 
     93                $json = "{\n"; 
     94                $json .= 'totalSize: '; 
     95                $json .= (is_numeric($this->totalSize)) ? $this->totalSize : 'null'; 
     96                $json .= ",\n"; 
     97                $json .= "items: [\n" . implode(",\n", $jsonParts) . "\n]\n"; 
     98                $json .= "}\n"; 
     99 
     100                return $json; 
    94101        } 
    95102