You are here

interface RestfulDataProviderInterface in RESTful 7

@file Contains \RestfulDataProviderInterface.

This interface makes sure that the basic CRUD operations are defined. If your data provider does not support any of the CRUD methods, implement and throw a \RestfulNotImplementedException.

Hierarchy

Expanded class hierarchy of RestfulDataProviderInterface

All classes that implement RestfulDataProviderInterface

File

plugins/restful/RestfulDataProviderInterface.php, line 12
Contains \RestfulDataProviderInterface.

View source
interface RestfulDataProviderInterface {

  /**
   * Get a list of entities.
   *
   * @return array
   *   Array of entities, as passed to RestfulEntityBase::viewEntity().
   *
   * @throws RestfulBadRequestException
   */
  public function index();

  /**
   * View a collection of items.
   *
   * @param array $ids
   *   An array of items to view.
   *
   * @return array
   *   The structured array ready to be rendered.
   */
  public function viewMultiple(array $ids);

  /**
   * View an item from the data source.
   *
   * @param mixed $id
   *   The unique ID for the item.
   *
   * @return array
   *   The structured array ready to be rendered for the current item.
   */
  public function view($id);

  /**
   * Update an item based on the request object.
   *
   * @param mixed $id
   *   The unique ID for the item.
   * @param boolean $full_replace
   *   TRUE if the data on the request represents the new object to replace the
   *   existing one. FALSE if the request only contains the bits that need
   *   updating.
   *
   * @return array
   *   The structured array for the item ready to be rendered.
   */
  public function update($id, $full_replace = FALSE);

  /**
   * Create an item from the request object.
   *
   * @return array
   *   The structured array for the item ready to be rendered.
   */
  public function create();

  /**
   * Remove the item from the data source.
   *
   * @param mixed $id
   *   The unique ID for the item.
   */
  public function remove($id);

}

Members

Namesort descending Modifiers Type Description Overrides
RestfulDataProviderInterface::create public function Create an item from the request object.
RestfulDataProviderInterface::index public function Get a list of entities.
RestfulDataProviderInterface::remove public function Remove the item from the data source.
RestfulDataProviderInterface::update public function Update an item based on the request object.
RestfulDataProviderInterface::view public function View an item from the data source.
RestfulDataProviderInterface::viewMultiple public function View a collection of items.