You are here

class Resource in RESTful 7.2

Same name in this branch
  1. 7.2 src/Annotation/Resource.php \Drupal\restful\Annotation\Resource
  2. 7.2 src/Plugin/resource/Resource.php \Drupal\restful\Plugin\resource\Resource

Defines a Resource annotation object.

Hierarchy

  • class \Drupal\restful\Annotation\Resource extends \Drupal\Component\Annotation\Plugin

Expanded class hierarchy of Resource

39 classes are annotated with Resource
AccessToken__1_0 in modules/restful_token_auth/src/Plugin/resource/AccessToken__1_0.php
Class AccessToken__1_0 @package Drupal\restful_token_auth\Plugin\resource
Articles__1_0 in modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_0.php
Class Articles @package Drupal\restful\Plugin\resource
Articles__1_1 in modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_1.php
Class Articles @package Drupal\restful\Plugin\resource
Articles__1_3 in modules/restful_token_auth/modules/restful_token_auth_test/src/Plugin/resource/Articles__1_3.php
Class Articles__1_3 @package Drupal\restful\Plugin\resource
Articles__1_4 in modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_4.php
Class Articles__1_4 @package Drupal\restful\Plugin\resource

... See full list

File

src/Annotation/Resource.php, line 19
Contains \Drupal\restful\Annotation\Resource.

Namespace

Drupal\restful\Annotation
View source
class Resource extends Plugin {

  /**
   * Major version.
   *
   * @var int
   */
  public $majorVersion = 1;

  /**
   * Minor version.
   *
   * @var int
   */
  public $minorVersion = 0;

  /**
   * Resource name.
   *
   * @var string
   */
  public $name;

  /**
   * Resource.
   *
   * This is used for the resource URL.
   *
   * @var string
   */
  public $resource;

  /**
   * Formatter.
   *
   * @var string
   */
  public $formatter;

  /**
   * Description.
   *
   * @var string
   */
  public $description = '';

  /**
   * Authentication types.
   *
   * @var array|bool
   */
  public $authenticationTypes = array();

  /**
   * Authentication optional.
   *
   * @var bool
   */
  public $authenticationOptional = FALSE;

  /**
   * Data provider options.
   *
   * Contains all the information for the data provider.
   *
   * @var array
   */
  public $dataProvider = array();

  /**
   * Cache render.
   *
   * Cache render options.
   *
   * @var array|bool
   */
  public $renderCache = array();

  /**
   * Hook menu. TRUE if the resource should declare a menu item automatically.
   *
   * @var bool
   */
  public $hookMenu = TRUE;

  /**
   * The path to be used as the menu item.
   *
   * Leave it empty to create one automatically.
   *
   * @var string
   */
  public $hookItem;

  /**
   * Autocomplete options.
   *
   * 'string' => 'foo',
   * 'operator' => 'STARTS_WITH',
   *
   * @var array
   */
  public $autocomplete = array();

  /**
   * Access control using the HTTP Access-Control-Allow-Origin header.
   *
   * @var string
   */
  public $allowOrigin;

  /**
   * Determines if a resource should be discoverable, and appear under /api.
   *
   * @var bool
   */
  public $discoverable = TRUE;

  /**
   * URL parameters.
   *
   * @var array
   */
  public $urlParams = array();

  /**
   * {@inheritdoc}
   */
  public function getId() {

    // The ID of the resource plugin is its name.
    return $this->definition['name'];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Resource::$allowOrigin public property Access control using the HTTP Access-Control-Allow-Origin header.
Resource::$authenticationOptional public property Authentication optional.
Resource::$authenticationTypes public property Authentication types.
Resource::$autocomplete public property Autocomplete options.
Resource::$dataProvider public property Data provider options.
Resource::$description public property Description.
Resource::$discoverable public property Determines if a resource should be discoverable, and appear under /api.
Resource::$formatter public property Formatter.
Resource::$hookItem public property The path to be used as the menu item.
Resource::$hookMenu public property Hook menu. TRUE if the resource should declare a menu item automatically.
Resource::$majorVersion public property Major version.
Resource::$minorVersion public property Minor version.
Resource::$name public property Resource name.
Resource::$renderCache public property Cache render.
Resource::$resource public property Resource.
Resource::$urlParams public property URL parameters.
Resource::getId public function