eZ\Publish\Core\REST\Common\Output\Visitor::getMediaType PHP Method

getMediaType() public method

Generates a media type for $type based on the used generator.
See also: eZ\Publish\Core\REST\Common\Generator::getMediaType()
public getMediaType ( string $type ) : string
$type string
return string
    public function getMediaType($type)
    {
        return $this->generator->getMediaType($type);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Deletes $section from content repository.
  *
  * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException If the specified section is not found
  * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException If the current user user is not allowed to delete a section
  * @throws \eZ\Publish\API\Repository\Exceptions\BadStateException  if section can not be deleted
  *         because it is still assigned to some contents.
  *
  * @param \eZ\Publish\API\Repository\Values\Content\Section $section
  */
 public function deleteSection(Section $section)
 {
     $response = $this->client->request('DELETE', $section->id, new Message(array('Accept' => $this->outputVisitor->getMediaType('Section'))));
     if (!empty($response->body)) {
         $this->inputDispatcher->parse($response);
     }
 }
All Usage Examples Of eZ\Publish\Core\REST\Common\Output\Visitor::getMediaType