Ejemplo n.º 1
0
 /**
  * Determines if the given writer is capable of writing the response or not
  * @param Version $responseVersion the OData version of the response
  * @param string $contentType the Content Type of the response
  * @return boolean true if the writer can handle the response, false otherwise
  */
 public function canHandle(Version $responseVersion, $contentType)
 {
     if ($responseVersion != Version::v3()) {
         return false;
     }
     $parts = explode(";", $contentType);
     //It must be app/json and have the right odata= piece
     return in_array(MimeTypes::MIME_APPLICATION_JSON, $parts) && in_array($this->metadataLevel->getValue(), $parts);
 }