コード例 #1
0
 protected function convertDocument($data)
 {
     $this->validator->validateContent($data);
     $document = new Document();
     if (isset($data->errors)) {
         $document->errors = $data->errors;
         // Todo: convert errors to objects if needed.
     } else {
         $resources = $data->data;
         if (is_array($resources)) {
             $document->singleResource = false;
             $resources = $this->convertResources($resources);
         } else {
             $document->singleResource = true;
             $resources = $this->convertResource($resources);
         }
         $document->resources = $resources;
     }
     return $document;
 }
コード例 #2
0
 public function validateRequest(Request $request)
 {
     return $this->validator->validateRequest($request);
 }