You are here

interface RestWSFormatInterface in RESTful Web Services 7

Same name and namespace in other branches
  1. 7.2 restws.formats.inc \RestWSFormatInterface

Interface implemented by formatter implementations for the http client.

Hierarchy

Expanded class hierarchy of RestWSFormatInterface

All classes that implement RestWSFormatInterface

File

./restws.formats.inc, line 11
RESTful web services module formats.

View source
interface RestWSFormatInterface {

  /**
   * Gets the representation of a resource.
   *
   * @param RestWSResourceControllerInterface $resourceController
   *   The controller used to retrieve the resource.
   * @param int|string $id
   *   The id of the resource that should be returned.
   *
   * @return string
   *   The representation of the resource.
   */
  public function viewResource($resourceController, $id);

  /**
   * Create a resource.
   *
   * @param RestWSResourceControllerInterface $resourceController
   *   The controller used to create the resource.
   * @param string $data
   *   The representation of the resource.
   *
   * @return int|string
   *   The id of the newly created resource.
   */
  public function createResource($resourceController, $data);

  /**
   * Update a resource.
   *
   * @param RestWSResourceControllerInterface $resourceController
   *   The controller used to update the resource.
   * @param int|string $id
   *   The id of the resource that should be updated.
   * @param string $data
   *   The representation of the resource.
   */
  public function updateResource($resourceController, $id, $data);

  /**
   * Delete a resource.
   *
   * @param RestWSResourceControllerInterface $resourceController
   *   The controller used to update the resource.
   * @param int|string $id
   *   The id of the resource that should be deleted.
   */
  public function deleteResource($resourceController, $id);

  /**
   * Returns the mime type of this format, e.g. 'application/json' or
   * 'application/xml'.
   */
  public function mimeType();

  /**
   * Returns the short name of this format.
   *
   * @return string
   *   The format name, example: "json".
   */
  public function getName();

}

Members

Namesort descending Modifiers Type Description Overrides
RestWSFormatInterface::createResource public function Create a resource. 1
RestWSFormatInterface::deleteResource public function Delete a resource. 1
RestWSFormatInterface::getName public function Returns the short name of this format. 1
RestWSFormatInterface::mimeType public function Returns the mime type of this format, e.g. 'application/json' or 'application/xml'. 1
RestWSFormatInterface::updateResource public function Update a resource. 1
RestWSFormatInterface::viewResource public function Gets the representation of a resource. 1