Full Code of RESTful-Drupal/restful for AI

7.x-2.x d996c6ee6043 cached
271 files
1011.1 KB
264.6k tokens
1485 symbols
1 requests
Download .txt
Showing preview only (1,095K chars total). Download the full file or copy to clipboard to get everything.
Repository: RESTful-Drupal/restful
Branch: 7.x-2.x
Commit: d996c6ee6043
Files: 271
Total size: 1011.1 KB

Directory structure:
gitextract_cruhgny1/

├── .travis.yml
├── README.md
├── docs/
│   ├── api_drupal.md
│   ├── api_url.md
│   ├── documentation.md
│   └── plugin.md
├── help/
│   ├── problem-instances-bad-request.html
│   ├── problem-instances-flood.html
│   ├── problem-instances-forbidden.html
│   ├── problem-instances-gone.html
│   ├── problem-instances-incompatible-field-definition.html
│   ├── problem-instances-not-found.html
│   ├── problem-instances-not-implemented.html
│   ├── problem-instances-server-configuration.html
│   ├── problem-instances-server-error.html
│   ├── problem-instances-service-unavailable.html
│   ├── problem-instances-unauthorized.html
│   ├── problem-instances-unprocessable-entity.html
│   ├── problem-instances-unsupported-media-type.html
│   ├── problem-instances.html
│   ├── readme.html
│   └── restful.help.ini
├── modules/
│   ├── restful_example/
│   │   ├── restful_example.info
│   │   ├── restful_example.module
│   │   └── src/
│   │       └── Plugin/
│   │           ├── formatter/
│   │           │   └── FormatterHalXml.php
│   │           └── resource/
│   │               ├── Tags__1_0.php
│   │               ├── comment/
│   │               │   ├── Comments__1_0.php
│   │               │   └── DataProviderComment.php
│   │               ├── node/
│   │               │   └── article/
│   │               │       ├── v1/
│   │               │       │   ├── Articles__1_0.php
│   │               │       │   ├── Articles__1_1.php
│   │               │       │   ├── Articles__1_4.php
│   │               │       │   ├── Articles__1_5.php
│   │               │       │   ├── Articles__1_6.php
│   │               │       │   └── Articles__1_7.php
│   │               │       └── v2/
│   │               │           ├── Articles__2_0.php
│   │               │           └── Articles__2_1.php
│   │               └── variables/
│   │                   ├── DataInterpreterVariable.php
│   │                   ├── DataProviderVariable.php
│   │                   ├── DataProviderVariableInterface.php
│   │                   └── Variables__1_0.php
│   └── restful_token_auth/
│       ├── modules/
│       │   └── restful_token_auth_test/
│       │       ├── restful_token_auth_test.info
│       │       ├── restful_token_auth_test.module
│       │       └── src/
│       │           └── Plugin/
│       │               └── resource/
│       │                   └── Articles__1_3.php
│       ├── restful_token_auth.admin.inc
│       ├── restful_token_auth.info
│       ├── restful_token_auth.install
│       ├── restful_token_auth.module
│       ├── src/
│       │   ├── Entity/
│       │   │   ├── RestfulTokenAuth.php
│       │   │   └── RestfulTokenAuthController.php
│       │   └── Plugin/
│       │       ├── authentication/
│       │       │   └── TokenAuthentication.php
│       │       └── resource/
│       │           ├── AccessToken__1_0.php
│       │           ├── RefreshToken__1_0.php
│       │           └── TokenAuthenticationBase.php
│       └── tests/
│           └── RestfulTokenAuthenticationTestCase.test
├── restful.admin.inc
├── restful.api.php
├── restful.cache.inc
├── restful.entity.inc
├── restful.info
├── restful.install
├── restful.module
├── src/
│   ├── Annotation/
│   │   ├── Authentication.php
│   │   ├── Formatter.php
│   │   ├── RateLimit.php
│   │   └── Resource.php
│   ├── Authentication/
│   │   ├── AuthenticationManager.php
│   │   ├── AuthenticationManagerInterface.php
│   │   ├── AuthenticationPluginCollection.php
│   │   ├── UserSessionState.php
│   │   └── UserSessionStateInterface.php
│   ├── Exception/
│   │   ├── BadRequestException.php
│   │   ├── FloodException.php
│   │   ├── ForbiddenException.php
│   │   ├── GoneException.php
│   │   ├── InaccessibleRecordException.php
│   │   ├── IncompatibleFieldDefinitionException.php
│   │   ├── InternalServerErrorException.php
│   │   ├── NotFoundException.php
│   │   ├── NotImplementedException.php
│   │   ├── RestfulException.php
│   │   ├── ServerConfigurationException.php
│   │   ├── ServiceUnavailableException.php
│   │   ├── UnauthorizedException.php
│   │   ├── UnprocessableEntityException.php
│   │   └── UnsupportedMediaTypeException.php
│   ├── Formatter/
│   │   ├── FormatterManager.php
│   │   ├── FormatterManagerInterface.php
│   │   └── FormatterPluginCollection.php
│   ├── Http/
│   │   ├── HttpHeader.php
│   │   ├── HttpHeaderBag.php
│   │   ├── HttpHeaderBagInterface.php
│   │   ├── HttpHeaderInterface.php
│   │   ├── HttpHeaderNull.php
│   │   ├── Request.php
│   │   ├── RequestInterface.php
│   │   ├── Response.php
│   │   └── ResponseInterface.php
│   ├── Plugin/
│   │   ├── AuthenticationPluginManager.php
│   │   ├── ConfigurablePluginTrait.php
│   │   ├── FormatterPluginManager.php
│   │   ├── RateLimitPluginManager.php
│   │   ├── ResourcePluginManager.php
│   │   ├── SemiSingletonTrait.php
│   │   ├── authentication/
│   │   │   ├── Authentication.php
│   │   │   ├── AuthenticationInterface.php
│   │   │   ├── BasicAuthentication.php
│   │   │   ├── CookieAuthentication.php
│   │   │   └── OAuth2ServerAuthentication.php
│   │   ├── formatter/
│   │   │   ├── Formatter.php
│   │   │   ├── FormatterHalJson.php
│   │   │   ├── FormatterInterface.php
│   │   │   ├── FormatterJson.php
│   │   │   ├── FormatterJsonApi.php
│   │   │   └── FormatterSingleJson.php
│   │   ├── rate_limit/
│   │   │   ├── RateLimit.php
│   │   │   ├── RateLimitGlobal.php
│   │   │   ├── RateLimitInterface.php
│   │   │   └── RateLimitRequest.php
│   │   └── resource/
│   │       ├── AuthenticatedResource.php
│   │       ├── AuthenticatedResourceInterface.php
│   │       ├── CrudInterface.php
│   │       ├── CsrfToken.php
│   │       ├── DataInterpreter/
│   │       │   ├── ArrayWrapper.php
│   │       │   ├── ArrayWrapperInterface.php
│   │       │   ├── DataInterpreterArray.php
│   │       │   ├── DataInterpreterBase.php
│   │       │   ├── DataInterpreterEMW.php
│   │       │   ├── DataInterpreterInterface.php
│   │       │   ├── DataInterpreterPlug.php
│   │       │   ├── PluginWrapper.php
│   │       │   └── PluginWrapperInterface.php
│   │       ├── DataProvider/
│   │       │   ├── CacheDecoratedDataProvider.php
│   │       │   ├── CacheDecoratedDataProviderInterface.php
│   │       │   ├── DataProvider.php
│   │       │   ├── DataProviderDbQuery.php
│   │       │   ├── DataProviderDbQueryInterface.php
│   │       │   ├── DataProviderDecorator.php
│   │       │   ├── DataProviderEntity.php
│   │       │   ├── DataProviderEntityDecorator.php
│   │       │   ├── DataProviderEntityInterface.php
│   │       │   ├── DataProviderFile.php
│   │       │   ├── DataProviderInterface.php
│   │       │   ├── DataProviderNode.php
│   │       │   ├── DataProviderNull.php
│   │       │   ├── DataProviderPlug.php
│   │       │   ├── DataProviderResource.php
│   │       │   ├── DataProviderResourceInterface.php
│   │       │   └── DataProviderTaxonomyTerm.php
│   │       ├── Decorators/
│   │       │   ├── CacheDecoratedResource.php
│   │       │   ├── CacheDecoratedResourceInterface.php
│   │       │   ├── RateLimitDecoratedResource.php
│   │       │   ├── ResourceDecoratorBase.php
│   │       │   └── ResourceDecoratorInterface.php
│   │       ├── Discovery.php
│   │       ├── Field/
│   │       │   ├── PublicFieldInfo/
│   │       │   │   ├── PublicFieldInfoBase.php
│   │       │   │   ├── PublicFieldInfoEntity.php
│   │       │   │   ├── PublicFieldInfoEntityInterface.php
│   │       │   │   ├── PublicFieldInfoInterface.php
│   │       │   │   └── PublicFieldInfoNull.php
│   │       │   ├── ResourceField.php
│   │       │   ├── ResourceFieldBase.php
│   │       │   ├── ResourceFieldCollection.php
│   │       │   ├── ResourceFieldCollectionInterface.php
│   │       │   ├── ResourceFieldDbColumn.php
│   │       │   ├── ResourceFieldDbColumnInterface.php
│   │       │   ├── ResourceFieldEntity.php
│   │       │   ├── ResourceFieldEntityAlterableInterface.php
│   │       │   ├── ResourceFieldEntityFile.php
│   │       │   ├── ResourceFieldEntityInterface.php
│   │       │   ├── ResourceFieldEntityReference.php
│   │       │   ├── ResourceFieldEntityReferenceInterface.php
│   │       │   ├── ResourceFieldEntityText.php
│   │       │   ├── ResourceFieldFileEntityReference.php
│   │       │   ├── ResourceFieldInterface.php
│   │       │   ├── ResourceFieldKeyValue.php
│   │       │   ├── ResourceFieldReference.php
│   │       │   ├── ResourceFieldResource.php
│   │       │   └── ResourceFieldResourceInterface.php
│   │       ├── FilesUpload__1_0.php
│   │       ├── LoginCookie__1_0.php
│   │       ├── Resource.php
│   │       ├── ResourceDbQuery.php
│   │       ├── ResourceEntity.php
│   │       ├── ResourceInterface.php
│   │       ├── ResourceNode.php
│   │       └── Users__1_0.php
│   ├── RateLimit/
│   │   ├── Entity/
│   │   │   ├── RateLimit.php
│   │   │   └── RateLimitController.php
│   │   ├── RateLimitManager.php
│   │   ├── RateLimitManagerInterface.php
│   │   └── RateLimitPluginCollection.php
│   ├── RenderCache/
│   │   ├── Entity/
│   │   │   ├── CacheFragment.php
│   │   │   └── CacheFragmentController.php
│   │   ├── RenderCache.php
│   │   └── RenderCacheInterface.php
│   ├── Resource/
│   │   ├── EnabledArrayIterator.php
│   │   ├── ResourceManager.php
│   │   ├── ResourceManagerInterface.php
│   │   └── ResourcePluginCollection.php
│   ├── RestfulManager.php
│   └── Util/
│       ├── EntityFieldQuery.php
│       ├── EntityFieldQueryRelationalConditionsInterface.php
│       ├── ExplorableDecoratorInterface.php
│       ├── PersistableCache.php
│       ├── PersistableCacheInterface.php
│       ├── RelationalFilter.php
│       ├── RelationalFilterInterface.php
│       └── StringHelper.php
└── tests/
    ├── RestfulAuthenticationTestCase.test
    ├── RestfulAutoCompleteTestCase.test
    ├── RestfulCommentTestCase.test
    ├── RestfulCreateEntityTestCase.test
    ├── RestfulCreateNodeTestCase.test
    ├── RestfulCreatePrivateNodeTestCase.test
    ├── RestfulCreateTaxonomyTermTestCase.test
    ├── RestfulCsrfTokenTestCase.test
    ├── RestfulCurlBaseTestCase.test
    ├── RestfulDataProviderPlugPluginsTestCase.test
    ├── RestfulDbQueryTestCase.test
    ├── RestfulDiscoveryTestCase.test
    ├── RestfulEntityAndPropertyAccessTestCase.test
    ├── RestfulEntityUserAccessTestCase.test
    ├── RestfulEntityValidatorTestCase.test
    ├── RestfulExceptionHandleTestCase.test
    ├── RestfulForbiddenItemsTestCase.test
    ├── RestfulGetHandlersTestCase.test
    ├── RestfulHalJsonTestCase.test
    ├── RestfulHookMenuTestCase.test
    ├── RestfulJsonApiTestCase.test
    ├── RestfulListEntityMultipleBundlesTestCase.test
    ├── RestfulListTestCase.test
    ├── RestfulPassThroughTestCase.test
    ├── RestfulRateLimitTestCase.test
    ├── RestfulReferenceTestCase.test
    ├── RestfulRenderCacheTestCase.test
    ├── RestfulSimpleJsonTestCase.test
    ├── RestfulSubResourcesCreateEntityTestCase.test
    ├── RestfulUpdateEntityCurlTestCase.test
    ├── RestfulUpdateEntityTestCase.test
    ├── RestfulUserLoginCookieTestCase.test
    ├── RestfulVariableTestCase.test
    ├── RestfulViewEntityMultiLingualTestCase.test
    ├── RestfulViewEntityTestCase.test
    ├── RestfulViewModeAndFormatterTestCase.test
    └── modules/
        ├── restful_node_access_test/
        │   ├── restful_node_access_test.info
        │   └── restful_node_access_test.module
        └── restful_test/
            ├── restful_test.info
            ├── restful_test.install
            ├── restful_test.module
            └── src/
                └── Plugin/
                    └── resource/
                        ├── DataProvider/
                        │   └── DataProviderFileTest.php
                        ├── db_query_test/
                        │   └── v1/
                        │       └── DbQueryTest__1_0.php
                        ├── entity_test/
                        │   ├── EntityTests__1_0.php
                        │   ├── main/
                        │   │   └── v1/
                        │   │       ├── Main__1_0.php
                        │   │       ├── Main__1_1.php
                        │   │       ├── Main__1_2.php
                        │   │       ├── Main__1_3.php
                        │   │       ├── Main__1_4.php
                        │   │       ├── Main__1_5.php
                        │   │       ├── Main__1_6.php
                        │   │       ├── Main__1_7.php
                        │   │       └── Main__1_8.php
                        │   └── tests/
                        │       └── Tests__1_0.php
                        ├── file/
                        │   └── file_upload_test/
                        │       └── v1/
                        │           └── FilesUploadTest__1_0.php
                        ├── node/
                        │   └── test_article/
                        │       └── v1/
                        │           ├── TestArticles__1_0.php
                        │           ├── TestArticles__1_1.php
                        │           ├── TestArticles__1_2.php
                        │           ├── TestArticles__1_3.php
                        │           └── TestArticles__1_4.php
                        ├── restful_test_translatable_entity/
                        │   └── v1/
                        │       └── RestfulTestTranslatableEntityResource__1_0.php
                        └── taxonomy_term/
                            └── v1/
                                ├── DataProviderTaxonomyTerm.php
                                └── TestTags__1_0.php

================================================
FILE CONTENTS
================================================

================================================
FILE: .travis.yml
================================================
language: php

php:
  - 5.5
  - 5.6

env:
  - PATH=$PATH:/home/travis/.composer/vendor/bin

# This will create the database
mysql:
  database: drupal
  username: root
  encoding: utf8

install:
  # Grab Drush
  - composer global require "drush/drush:7.*"
  - phpenv rehash
  # Make sure we don't fail when checking out projects
  - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
  - sudo cat /etc/apt/sources.list
  - echo "deb http://archive.ubuntu.com/ubuntu/ precise multiverse" | sudo tee -a /etc/apt/sources.list
  - echo "deb-src http://archive.ubuntu.com/ubuntu/ precise multiverse" | sudo tee -a /etc/apt/sources.list
  - echo "deb http://archive.ubuntu.com/ubuntu/ precise-updates multiverse" | sudo tee -a /etc/apt/sources.list
  - echo "deb-src http://archive.ubuntu.com/ubuntu/ precise-updates multiverse" | sudo tee -a /etc/apt/sources.list
  - echo "deb http://security.ubuntu.com/ubuntu precise-security multiverse" | sudo tee -a /etc/apt/sources.list
  - echo "deb-src http://security.ubuntu.com/ubuntu precise-security multiverse" | sudo tee -a /etc/apt/sources.list

  # LAMP package installation (mysql is already started)
  - sudo apt-get update
  - sudo apt-get install apache2 libapache2-mod-fastcgi
  # enable php-fpm, travis does not support any other method with php and apache
  - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
  - sudo a2enmod rewrite actions fastcgi alias
  - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
  # Make sure the apache root is in our wanted directory
  - echo "$(curl -fsSL https://gist.githubusercontent.com/nickveenhof/11386315/raw/b8abaf9304fe12b5cc7752d39c29c1edae8ac2e6/gistfile1.txt)" | sed -e "s,PATH,$TRAVIS_BUILD_DIR/../drupal,g" | sudo tee /etc/apache2/sites-available/default > /dev/null
  # Set sendmail so drush doesn't throw an error during site install.
  - echo "sendmail_path='true'" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`
  # Forward the errors to the syslog so we can print them
  - echo "error_log=syslog" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`
  # Get latest drupal 8 core
  - cd $TRAVIS_BUILD_DIR/..
  - git clone --depth 1 --branch 7.x http://git.drupal.org/project/drupal.git
  # Restart apache and test it
  - sudo service apache2 restart
  - curl -v "http://localhost"
  # Re-enable when trying to get CodeSniffer doesn't return a 403 anymore.
  #- composer global require drupal/coder:\>7

before_script:
  - cd $TRAVIS_BUILD_DIR/../drupal
  # Update drupal core
  - git pull origin 7.x
  # Install the site
  - drush -v site-install minimal --db-url=mysql://root:@localhost/drupal --yes
  # Increase max_allowed_packet to avoid MySQL errors
  - echo -e "[server]\nmax_allowed_packet=64M" | sudo tee -a /etc/mysql/conf.d/drupal.cnf
  - sudo service mysql restart
  - phpenv rehash

script:
  # Go to our Drupal module directory
  - mkdir $TRAVIS_BUILD_DIR/../drupal/sites/all/modules/restful
  - cp -R $TRAVIS_BUILD_DIR/* $TRAVIS_BUILD_DIR/../drupal/sites/all/modules/restful/
  # Go to our Drupal main directory
  - cd $TRAVIS_BUILD_DIR/../drupal

  # Download and enable module and its dependencies
  - drush --yes dl registry_autoload
  - drush --yes dl entity_validator-7.x-2.0
  - drush --yes dl plug
  - drush --yes dl entity
  - drush --yes dl entityreference
  - drush --yes dl uuid
  - drush --yes pm-enable plug

  # Patch Entity API.
  - curl -O https://www.drupal.org/files/issues/2086225-entity-access-check-node-create-3.patch
  - patch -p1 $TRAVIS_BUILD_DIR/../drupal/sites/all/modules/entity/modules/callbacks.inc  < 2086225-entity-access-check-node-create-3.patch

  # Enable the RESTful modules
  - drush --yes pm-enable simpletest restful restful_token_auth
  # Run the tests
  - cd $TRAVIS_BUILD_DIR/../drupal
  - php ./scripts/run-tests.sh --php $(which php) --concurrency 4 --verbose --color --url http://localhost RESTful 2>&1 | tee /tmp/simpletest-result.txt
  - egrep -i "([1-9]+ fail)|(Fatal error)|([1-9]+ exception)" /tmp/simpletest-result.txt && exit 1
  - exit 0


================================================
FILE: README.md
================================================
[![Build Status](https://travis-ci.org/RESTful-Drupal/restful.svg?branch=7.x-2.x)](https://travis-ci.org/RESTful-Drupal/restful)

# RESTful best practices for Drupal

This module allows Drupal to be operated via RESTful HTTP requests, using best
practices for security, performance, and usability.

## Concept
Here are the differences between RESTful and other modules, such as RestWs and
Services Entity:

* RESTful requires explicitly declaring the exposed API. When enabling
the module, nothing happens until a plugin declares it.
* Resources are exposed by bundle, rather than by entity.  This would allow a
developer to expose only nodes of a certain type, for example.
* The exposed properties need to be explicitly declared. This allows a _clean_
output without Drupal's internal implementation leaking out. This means the
consuming client doesn't need to know if an entity is a node or a term, nor will
 they be presented with the ``field_`` prefix.
* Resource versioning is built-in, so that resources can be reused with multiple
consumers.  The versions are at the resource level, for more flexibility and
control.
* It has configurable output formats. It ships with JSON (the default one), JSON+HAL and as an example also XML.
* Audience is developers and not site builders.
* Provide a key tool for a headless Drupal. See the [AngularJs form](https://github.com/Gizra/restful/blob/7.x-1.x/modules/restful_angular_example/README.md) example module.


## Module dependencies

  * [Entity API](https://drupal.org/project/entity), with the following patches:
  * [Prevent notice in entity_metadata_no_hook_node_access() when node is not saved](https://drupal.org/node/2086225#comment-8768373)

## Recipes
Read even more examples on how to use the RESTful module in the [module documentation
node](https://www.drupal.org/node/2380679) in Drupal.org. Make sure you read the _Recipes_
section. If you have any to share, feel free to add your own recipes.

## Declaring a REST Endpoint

A RESTful endpoint is declared via a custom module that includes a plugin which
describes the resource you want to make available.  Here are the bare
essentials from one of the multiple examples in
[the example module](./modules/restful_example):

####restful\_custom/restful\_custom.info
```ini
name = RESTful custom
description = Custom RESTful resource.
core = 7.x
dependencies[] = restful

registry_autoload[] = PSR-4
```

####restful\_custom/src/Plugin/resource/Custom__1_0.php
```php

namespace Drupal\restful_custom\Plugin\resource;
use Drupal\restful\Plugin\resource\ResourceEntity;
use Drupal\restful\Plugin\resource\ResourceInterface;

/**
 * Class Custom__1_0
 * @package Drupal\restful_custom\Plugin\resource
 *
 * @Resource(
 *   name = "custom:1.0",
 *   resource = "custom",
 *   label = "Custom",
 *   description = "My custom resource!",
 *   authenticationTypes = TRUE,
 *   authenticationOptional = TRUE,
 *   dataProvider = {
 *     "entityType": "node",
 *     "bundles": {
 *       "article"
 *     },
 *   },
 *   majorVersion = 1,
 *   minorVersion = 0
 * )
 */
class Custom__1_0 extends ResourceEntity implements ResourceInterface {

  /**
   * Overrides EntityNode::publicFields().
   */
  public function publicFields() {
    $public_fields = parent::publicFields();

    $public_fields['body'] = array(
      'property' => 'body',
      'sub_property' => 'value',
    );

    return $public_fields;
  }
}
```

After declaring this plugin, the resource could be accessed at its root URL,
which would be `http://example.com/api/v1.0/custom`.

### Security, caching, output, and customization

See the [Defining a RESTful Plugin](./docs/plugin.md) document for more details.


## Using your API from within Drupal

The following examples use the _articles_ resource from the _restful\_example_
module.

#### Getting a specific version of a RESTful handler for a resource

```php
// Get handler v1.1
$handler = restful()->getResourceManager()->getPlugin('articles:1.1');
```

#### Create and update an entity
```php
$handler = restful()
  ->getResourceManager()
  ->getPlugin('articles:1.0');
// POST method, to create.
$result = restful()
  ->getFormatterManager()
  ->format($handler->doPost(array('label' => 'example title')));
$id = $result['id'];

// PATCH method to update only the title.
$request['label'] = 'new title';
restful()
  ->getFormatterManager()
  ->format($handler->doPatch($id, $request));
```

#### List entities
```php
$handler = restful()->getResourceManager()->getPlugin('articles:1.0');
$handler->setRequest(Request::create(''));
$result = restful()->getFormatterManager()->format($handler->process(), 'json');

// Output:
array(
  'data' => array(
    array(
      'id' => 1,
      'label' => 'example title',
      'self' => 'https://example.com/node/1',
    );
    array(
      'id' => 2,
      'label' => 'another title',
      'self' => 'https://example.com/node/2',
    );
  ),
);
```

### Sort, Filter, Range, and Sub Requests
See the [Using your API within drupal](./docs/api_drupal.md) documentation for
more details.

## Consuming your API
The following examples use the _articles_ resource from the _restful\_example_
module.

#### Consuming specific versions of your API
```shell
# Handler v1.0
curl https://example.com/api/articles/1 \
  -H "X-API-Version: v1.0"
# or
curl https://example.com/api/v1.0/articles/1

# Handler v1.1
curl https://example.com/api/articles/1 \
  -H "X-API-Version: v1.1"
# or
curl https://example.com/api/v1.1/articles/1
```


#### View multiple articles at once
```shell
# Handler v1.1
curl https://example.com/api/articles/1,2 \
  -H "X-API-Version: v1.1"
```


#### Returning autocomplete results
```shell
curl https://example.com/api/articles?autocomplete[string]=mystring
```


#### URL Query strings, HTTP headers, and HTTP requests
See the [Consuming Your API](./docs/api_url.md) document for more details.

## CORS
RESTful provides support for preflight requests (see the
[Wikipedia example](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing#Preflight_example)
for more details).

To configure the allowed domains, you can:

  - Go to `admin/config/services/restful` and set _CORS Preflight_ to the
allowed domain. This will apply globally unless overridden with the method
below.
  - Set the `allowOrigin` key in your resource definition (in the annotation)
to the allowed domain. This setting will only apply to this resource.

Bear in mind that this check is only performed to the top-level resource.
If you are composing resources with competing `allowOrigin` settings, the
top-level resource will be applied.

## Documenting your API
Clients can access documentation about a resource by making an `OPTIONS` HTTP
request to its root URL. The resource will respond with the field information
in the body, and the information about the available output formats and the
permitted HTTP methods will be contained in the headers.


### Automatic documentation
If your resource is an entity, then it will be partially self-documented,
without you needing to do anything else. This information is automatically
derived from the Entity API and Field API.

Here is a snippet from a typical JSON response using only the automatic
documentation:

```json
{
  "myfield": {
    "info": {
      "label": "My Field",
      "description": "A field within my resource."
    },
    "data": {
      "type": "string",
      "read_only": false,
      "cardinality": 1,
      "required": false
    },
    "form_element": {
      "type": "textfield",
      "default_value": "",
      "placeholder": "",
      "size": 255,
      "allowed_values": null
    }
  }
  // { ... other fields would follow ... }
}
```

Each field you've defined in `publicFields` will output an object similar
to the one listed above.


### Manual documentation
In addition to the automatic documentation provided to you out of the box, you
have the ability to manually document your resources.  See the [Documenting your API](./docs/documentation.md)
documentation for more details.


## Modules integration
* [Entity validator 2.x](https://www.drupal.org/project/entity_validator): Integrate
with a robust entity validation (RESTful 1.x requires Entity Validator 1.x).


## Credits
* [Gizra](http://gizra.com)
* [Mateu Aguiló Bosch](https://github.com/e0ipso)


================================================
FILE: docs/api_drupal.md
================================================
# Using Your API Within Drupal

The RESTful module allows your resources to be used within Drupal itself. For
example, you could define a resource, and then operate it within another
custom module.

In general, this is accomplished by using the resource manager in order to get a
handler for your resource, and then calling methods such as `get` or `post` to
make a request, which will operate the resource.

The request itself can be customized by passing in an array of key/value pairs.

## Read Contexts
The following keys apply to read contexts, in which you are using the `get`
method to return results from a resource.

### Sort
You can use the `'sort'` key to sort the list of entities by multiple
properties.  List every property in a comma-separated string, in the order that
you want to sort by.  Prefixing the property name with a dash (``-``) will sort
 by that property in a descending order; the default is ascending.

Bear in mind that for entity based resources, only those fields with a
`'property'` (matching to an entity property or a Field API field) can be used
for sorting.

If no sorting is specified the default sorting is by the entity ID.

```php
$handler = restful()
  ->getResourceManager()
  ->getPlugin('articles:1.0');

// Define the sorting by ID (descending) and label (ascending).
$query['sort'] = '-id,label';
$result = restful()
  ->getFormatterManager()
  ->format($handler->doGet('', $query));

// Output:
array(
  'data' => array(
    array(
      'id' => 2,
      'label' => 'another title',
      'self' => 'https://example.com/node/2',
    ),
    array(
      'id' => 1,
      'label' => 'example title',
      'self' => 'https://example.com/node/1',
    ),
  ),
);
```


### Filter
Use the `'filter'` key to filter the list. You can provide as many filters as
you need.

```php
$handler = restful()
  ->getResourceManager()
  ->getPlugin('articles:1.0');

// Single value property.
$query['filter'] = array('label' => 'abc');
$result = restful()
  ->getFormatterManager()
  ->format($handler->doGet('', $query));
```

Bear in mind that for entity based resources, only those fields with a
`'property'` (matching to an entity property or a Field API field) can be used
for filtering.

Additionally you can provide multiple filters for the same field. That is
specially useful when filtering on multiple value fields. The following example
will get all the articles with the integer multiple field that contains all 1, 3
and 5.

```php
$handler = restful()
  ->getResourceManager()
  ->getPlugin('articles:1.0');

// Single value property.
$query['filter'] = array('integer_multiple' => array(
  'values' => array(1, 3, 5),
));
$result = restful()
  ->getFormatterManager()
  ->format($handler->doGet('', $query));
```

You can do more advanced filtering by providing values and operators. The
following example will get all the articles with an integer value more than 5
and another equal to 10.

```php
$handler = restful()
  ->getResourceManager()
  ->getPlugin('articles:1.0');

// Single value property.
$query['filter'] = array('integer_multiple' => array(
  'values' => array(5, 10),
  'operator' => array('>', '='),
));
$result = restful()
  ->getFormatterManager()
  ->format($handler->doGet('', $query));
```

### Autocomplete
By using the `'autocomplete'` key and supplying a query string, it is possible
to change the normal listing behavior into autocomplete.  This also changes
the normal output objects into key/value pairs which can be fed directly into
a Drupal autocomplete field.

The following is the API equivalent of
`https://example.com?autocomplete[string]=foo&autocomplete[operator]=STARTS_WITH`

```php
$handler = restful()
  ->getResourceManager()
  ->getPlugin('articles:1.0');

$query = array(
  'autocomplete' => array(
    'string' => 'foo',
    // Optional, defaults to "CONTAINS".
    'operator' => 'STARTS_WITH',
  ),
);

$handler->get('', $query);
```


### Range
Using the `'range'` key, you can control the number of elements per page you
want to show. This value will always be limited by the `$range` variable in your
 resource class. This variable defaults to 50.

```php
$handler = restful()
  ->getResourceManager()
  ->getPlugin('articles:1.0');

// Single value property.
$query['range'] = 25;
$result = $handler->get('', $query);
```

## Write Contexts

The following techniques apply to write contexts, in which you are using the
`post` method to create an entity defined by a resource.

### Sub-requests
It is possible to create multiple referencing entities in a single request. A
typical example would be a node referencing a new taxonomy term. For example if
there was a taxonomy reference or entity reference field called ``field_tags``
on the  Article bundle (node) with an ``articles`` and a Tags bundle (taxonomy
term) with a ``tags`` resource, we would define the relation via the
``ResourceEntity::publicFields()``

```php
public function publicFields() {
  $public_fields = parent::publicFields();
  // ...
  $public_fields['tags'] = array(
    'property' => 'field_tags',
    'resource' => array(
      'name' => 'tags',
      'minorVersion' => 1,
      'majorVersion' => 0,
    ),
  );
  // ...
  return $public_fields;
}

```

And create both entities with a single request:

```php
$handler = restful()
  ->getResourceManager()
  ->getPlugin('articles:1.0');

$parsed_body = array(
  'label' => 'parent',
  'body' => 'Drupal',
  'tags' => array(
    array(
      // Create a new term.
      'body' => array(
        'label' => 'child1',
      ),
      'request' => array(
        'method' => 'POST',
        'headers' => array(
          'X-CSRF-Token' => 'my-csrf-token',
        ),
      ),
    ),
    array(
      // PATCH an existing term.
      'body' => array(
        'label' => 'new title by PATCH',
      ),
      'id' => 12,
      'request' => array(
        'method' => 'PATCH',
      ),
    ),
    array(
      // PATCH an existing term.
      'body' => array(
        'label' => 'new title by PUT',
      ),
      'id' => 9,
      'request' => array(
        'method' => 'PUT',
      ),
    ),
    // Use an existing item.
    array(
      'id' => 21,
    ),
  ),
);

$handler->doPost($parsed_body);
```


## Error handling
If an error occurs while using the API within Drupal, a custom exception is
thrown.  All the exceptions thrown by the RESTful module extend the
`\Drupal\restful\Exception\RestfulException` class.


================================================
FILE: docs/api_url.md
================================================
# Consuming your API

The RESTful module allows your resources to be used by external clients via
HTTP requests.  This is the module's primary purpose.

You can manipulate the resources using different HTTP request types
(e.g. `POST`, `GET`, `DELETE`), HTTP headers, and special query strings
passed in the URL itself.

## Write operations
Write operations can be performed via the `POST` (to create items), `PUT` or `PATCH`
(to update items) HTTP methods.

### Basic example
The following request will create an article using the `articles` resource:

```http
POST /articles HTTP/1.1
Content-Type: application/json
Accept: application/json

{
  "title": "My article",
  "body": "<p>This is a short one</p>",
  "tags": [1, 6, 12]
}
```

Note how we are setting the properties that we want to set using JSON. The
provided payload format needs to match the contents of the `Content-Type` header
(in this case _application/json_).

It's also worth noting that when setting reference fields with multiple values,
you can submit an array of IDs or a string of IDs separated by commas.

### Advanced example
You use sub-requests to manipulate (create or alter) the relationships in a single request. The following example will:

  1. Update the title of the article to be _To TDD or Not_.
  1. Update the contents of tag 6 to replace it with the provided content.
  1. Create a new tag and assign it to the updated article.

```
PATCH /articles/1 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json

{
  "title": "To TDD or Not",
  "tags": [
    {
      "id": "6",
      "body": {
        "label": "Batman!",
        "description": "The gadget owner."
      },
      "request": {
        "method": "PATCH"
      }
    },
    {
      "body": {
        "label": "everything",
        "description": "I can only say: 42."
      },
      "request": {
        "method": "POST",
        "headers": {"Authorization": "Basic Yoasdkk1="}
      }
    }
  ]
}
```

See the
[extension specification](https://gist.github.com/e0ipso/cc95bfce66a5d489bb8a)
for an example using JSON API.

## Getting information about the resource

### Exploring the resource

Using a HTTP `GET` request on a resource's root URL will return information
about that resource, in addition to the data itself.

``` shell
curl https://example.com/api/
```
This will output all the available **latest** resources (of course, if you have
enabled the "Discovery Resource" option). For example, if there are 3 different
API version plugins for content type Article (1.0, 1.1, 2.0) it will display the
latest only (2.0 in this case).

If you want to display all the versions of all the resources declared, then add the
query **?all=true** like this.

``` shell
curl https://example.com/api?all=true
```

The data results are stored in the `data` property of the JSON response, while
the `self` and `next` objects contain information about the resource.

```javascript
{
  "data": [
    {
      "self": "https://example.com/api/v1.0/articles/123",
      "field": "A field value",
      "field2": "Another field value"
    },
    // { ... more results follow ... }
  ],
  "count": 100,
  "self": {
    "title": "Self",
    "href": "https://example.com/api/v1.0/articles"
  },
  "next": {
    "title": "Next",
    "href": "https://example.com/api/v1.0/articles?page=2"
  }
}
```


### Returning documentation about the resource

Using an HTTP `OPTIONS` request, you can return documentation about the
resource.  To do so, make an `OPTIONS` request to the resource's root URL.

```shell
curl -X OPTIONS -i https://example.com/api/v1.0/articles
```

The resource will respond with a JSON object that contains documentation for
each field defined by the resource.

See the _Documenting your API_ section of the [README file](../README.md)
for examples of the types of information returned by such a request.


## Returning specific fields
Using the ``?fields`` query string, you can declare which fields should be
returned.  Note that you can only return fields already being returned by
`publicFields()`.  This is used, for example, if you have many fields
in `publicFields()`, but your client only needs a few specific ones.

```shell
# Handler v1.0
curl https://example.com/api/v1/articles/2?fields=id
```

Returns:

```javascript
{
  "data": [{
    "id": "2",
    "label": "Foo"
  }]
}
```


## Applying a query filter
RESTful allows applying filters to the database query used to generate the list.

Bear in mind that for entity based resources, only those fields with a
`'property'` (matching to an entity property or a Field API field) can be used
for filtering.

```php
# Handler v1.0
curl https://example.com/api/v1/articles?filter[label]=abc
```

You can even filter results using basic operators. For instance to get all the
articles after a certain date:

```shell
# Handler v1.0
curl https://example.com/api/articles?filter[created][value]=1417591992&filter[created][operator]=">="
```

Additionally you can provide multiple filters for the same field. That is
especially useful when filtering on multiple value fields. The following example
will get all the articles with the `integer_multiple` field that contains all 1, 3
and 5.

```
curl https://example.com/api/articles?filter[integer_multiple][value][0]=1&filter[integer_multiple][value][1]=3&filter[integer_multiple][value][2]=5
```

You can do more advanced filtering by providing values and operators. The
following example will get all the articles with an `integer_multiple` value less than 5
and another equal to 10.

```
curl https://example.com/api/articles?filter[integer_multiple][value][0]=5&filter[integer_multiple][value][1]=10&filter[integer_multiple][operator][0]=">"&filter[integer_multiple][operator][1]="="
```

## Loading by an alternate ID.
Sometimes you need to load an entity by an alternate ID that is not the regular
entity ID, for example a unique ID title. All that you need to do is provide the
alternate ID as the regular resource ID and inform that the passed in ID is not
the regular entity ID but a different field. To do so use the `loadByFieldName`
query parameter.

```
curl -H 'X-API-version: v1.5' https://www.example.org/articles/1234-abcd-5678-efg0?loadByFieldName=uuid
```

That will load the article node and output it as usual. Since every REST
resource object has a canonical URL (and we are using a different one) a _Link_
header will be added to the response with the canonical URL so the consumer can
use it in future requests.

```
HTTP/1.1 200 OK
Date: Mon, 22 Dec 2014 08:08:53 GMT
Content-Type: application/hal+json; charset=utf-8
...
Link: https://www.example.org/articles/12; rel="canonical"

{
  ...
}
```

The only requirement to use this feature is that the value for your
`loadByFieldName` field needs to be one of your exposed fields. It is also up to
you to make sure that that field is unique. Note that in case that more than one
entity matches the provided ID, the first record will be loaded.

## Working with authentication providers
RESTful comes with ``cookie``, ``base_auth`` (user name and password in the HTTP
header) authentications providers, as well as a "RESTful token auth" module that
 has a `token` authentication provider.

Note: if you use cookie-based authentication then you also need to set the
HTTP ``X-CSRF-Token`` header on all writing requests (`POST`, `PUT` and `DELETE`).
You can retrieve the token from ``/api/session/token`` with a standard HTTP
`GET` request.

See [this](https://github.com/Gizra/angular-restful-auth) AngularJs example that
shows a login from a fully decoupled web app to a Drupal backend.

Note: If you use basic auth under `.htaccess` password you might hit a flood
exception, as the server is sending the `.htaccess` user name and password as the
authentication. In such a case you may set the ``restful_skip_basic_auth`` to
TRUE, in order to avoid using it. This will allow enabling and disabling the
basic auth on different environments.

```bash
# (Change username and password)
curl -u "username:password" https://example.com/api/login-token

# Response has access token.
{"access_token":"YOUR_TOKEN","refresh_token":"OTHER_TOKEN",...}

# Call a "protected" with token resource (Articles resource version 1.3 in "RESTful example")
curl https://example.com/api/v1.3/articles/1?access_token=YOUR_TOKEN

# Or use access-token instead of access_token for ensuring header is not going to be
# dropped out from $_SERVER so it remains compatible with other webservers different than apache.
curl -H "access-token: YOUR_TOKEN" https://example.com/api/v1.3/articles/1
```

## Error handling
If an error occurs when operating the REST endpoint via URL, a valid JSON object
with ``code``, ``message`` and ``description`` would be returned.

The RESTful module adheres to the [Problem Details for HTTP
APIs](http://tools.ietf.org/html/draft-nottingham-http-problem-06) draft to
improve DX when dealing with HTTP API errors. Download and enable the [Advanced
Help](https://drupal.org/project/advanced_help) module for more information
about the errors.

For example, trying to sort a list by an invalid key

```shell
curl https://example.com/api/v1/articles?sort=wrong_key
```

Will result with an HTTP code 400, and the following JSON:

```javascript
{
  'type' => 'http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1',
  'title' => 'The sort wrong_key is not allowed for this path.',
  'status' => 400,
  'detail' => 'Bad Request.',
}
```


================================================
FILE: docs/documentation.md
================================================
# Documenting your API

## Documenting your fields
When declaring a public field and its mappings, you can also provide information
about the field itself. This includes basic information about the field,
information about the data the field holds, and information about the form
element to generate on the client side for this field.

By declaring this information, you make it possible for clients to provide
form elements for your API using reusable form components.

```php
$public_fields['text_multiple'] = array(
  'property' => 'text_multiple',
  'discovery' => array(
    // Basic information about the field for human consumption.
    'info' => array(
      // The name of the field. Defaults to: ''.
      'name' => t('Text multiple'),
      // The description of the field. Defaults to: ''.
      'description' => t('This field holds different text inputs.'),
      // A custom piece of information we want to add to the documentation.
      'custom' => t('This is custom documentation'),
    ),
    // Information about the data that the field holds. Typically used to help the client to manage the data appropriately.
    'data' => array(
      // The type of data. For instance: 'int', 'string', 'boolean', 'object', 'array', ... Defaults to: NULL.
      'type' => 'string',
      // The number of elements that this field can contain. Defaults to: 1.
      'cardinality' => FIELD_CARDINALITY_UNLIMITED,
      // Avoid updating/setting this field. Typically used in fields representing the ID for the resource. Defaults to: FALSE.
      'read_only' => FALSE,
    ),
    'form_element' => array(
      // The type of the input element as in Form API. Defaults to: NULL.
      'type' => 'textfield',
      // The default value for the form element. Defaults to: ''.
      'default_value' => '',
      // The placeholder text for the form element. Defaults to: ''.
      'placeholder' => t('This is helpful.'),
      // The size of the form element (if applies). Defaults to: NULL.
      'size' => 255,
      // The allowed values for form elements with a limited set of options. Defaults to: NULL.
      'allowed_values' => NULL,
    ),
  ),
);
```

Note the `'custom'` key; you can add your own information to the `'discovery'`
property and it will be exposed as well.

Here is a snippet from the JSON response to an HTTP OPTIONS request made to the
above resource:

```json
"text_multiple": {
  "info": {
    "label": "",
    "description": "This field holds different text inputs.",
    "name": "Text multiple",
    "custom": "This is custom documentation"
  },
  "data": {
    "type": "string",
    "read_only": false,
    "cardinality": -1,
    "required": false
  },
  "form_element": {
    "type": "textfield",
    "default_value": "",
    "placeholder": "This is helpful.",
    "size": 255,
    "allowed_values": null
  }
},
```


================================================
FILE: docs/plugin.md
================================================
# Defining a RESTful Plugin

## Resources with multiple bundles
One of the things that your API design should have is entity uniformity. That
means that you should be able to describe the contents of a single item with a
schema. That in turn, refers to the ability to set expectation in the fields that
are going to be present for a given item, by explaining «I'm going to have fields
a, b and c and they are all strings».

If you have a resource for a Drupal entity type (ex: a node) that should output
different bundles (ex: article and page), then you have to make sure that you
only expose fields that are common to the both of them so the resulting payload
is uniform. Another way to expose them, in case that you need to expose different
fields, is to treat them as references. In that case you would have a public
field per bundle that contains a reference to each specific bundle (one for the
page and another one for the article, linked to the page and article resources).
You will need to set the field class manually for that field. See an example of
that in [EntityTests__1_0](../tests/modules/restful_test/src/Plugin/resource/entity_test/EntityTests__1_0.php).

## Defining the exposed fields
By default the RESTful module will expose the ID, label and URL of the entity.
You probably want to expose more than that. To do so you will need to implement
the `publicFields` method defining the names in the output array and how
those are mapped to the queried entity. For instance the following example will
retrieve the basic fields plus the body, tags and images from an article node.
The RESTful module will know to use the `MyArticlesResource` class because your
plugin definition will say so.

```php
class MyArticles__1_0 extends ResourceEntity {

  /**
   * Overrides ResourceEntity::publicFields().
   */
  public function publicFields() {
    $public_fields = parent::publicFields();

    $public_fields['body'] = array(
      'property' => 'body',
      'sub_property' => 'value',
    );

    $public_fields['tags'] = array(
      'property' => 'field_tags',
      'resource' => array(
        'tags' => 'tags',
      ),
    );

    $public_fields['image'] = array(
      'property' => 'field_image',
      'process_callbacks' => array(
        array($this, 'imageProcess'),
      ),
      // This will add 3 image variants in the output.
      'image_styles' => array('thumbnail', 'medium', 'large'),
    );

    return $public_fields;
  }

}
```

See [the inline documentation](https://github.com/RESTful-Drupal/restful/blob/7.x-1.x/plugins/restful/RestfulEntityBase.php)
for `publicFields` to get more details on exposing field data to your
resource.

If you need even more flexibility, you can use the `'callback'` key to name a
custom function to compute the field data.


## Defining a view mode
You can leverage Drupal core's view modes to render an entity and expose it as a
resource with RESTful. All you need is to set up a view mode that renders the
output you want to expose and tell RESTful to use it. This simplifies the
workflow of exposing your resource a lot, since you don't even need to create a
resource class, but it also offers you less features that are configured in the
`publicFields` method.

Use this method when you don't need any of the extra features that are added via
`publicFields` (like the discovery metadata, image styles for images,
process callbacks, custom access callbacks for properties, etc.). This is also a
good way to stub a resource really quick and then move to the more fine grained
method.

To use this method, set the `'view_mode'` key in the plugin definition file:

```php
$plugin = array(
  'label' => t('Articles'),
  'resource' => 'articles',
  'name' => 'articles__1_7',
  'entity_type' => 'node',
  'bundle' => 'article',
  'description' => t('Export the article content type using view modes.'),
  'class' => 'RestfulEntityBaseNode',
  'authentication_types' => TRUE,
  'authentication_optional' => TRUE,
  'minor_version' => 7,
  // Add the view mode information.
  'view_mode' => array(
    'name' => 'default',
    'field_map' => array(
      'body' => 'body',
      'field_tags' => 'tags',
      'field_image' => 'image',
    ),
  ),
);
```


## Disable filter capability
The filter parameter can be disabled in your resource plugin definition:

```php
$plugin = array(
  ...
  'url_params' => array(
    'filter' => FALSE,
  ),
);
```


## Defining a default sort
You can also define default sort fields in your plugin, by overriding
`defaultSortInfo()` in your class definition.

This method should return an associative array, with each element having a key
that matches a field from `publicFields()`, and a value of either 'ASC' or
'DESC'. Bear in mind that for entity based resources, only those fields with a
`'property'` (matching to an entity property or a Field API field) can be used
for sorting.

This default sort will be ignored if the request URL contains a sort query.

```php
class MyPlugin extends \RestfulEntityBaseTaxonomyTerm {
  /**
   * Overrides \RestfulEntityBase::defaultSortInfo().
   */
  public function defaultSortInfo() {
    // Sort by 'id' in descending order.
    return array('id' => 'DESC');
  }
}
```


## Disabling sort capability
The sort parameter can be disabled in your resource plugin definition:

```php
$plugin = array(
  ...
  'url_params' => array(
    'sort' => FALSE,
  ),
);
```

## Setting the default range
The range can be specified by setting `$this->range` in your plugin definition.


### Disabling the range parameter
The range parameter can be disabled in your resource plugin definition:

```php
$plugin = array(
  ...
  'url_params' => array(
    'range' => FALSE,
  ),
);
```


## Image derivatives
Many client side technologies have lots of problems resizing images to serve
them optimized and thus avoiding browser scaling. For that reason the RESTful
module will let you specify an array of image style names to get an array of
image derivatives for your image fields. Just add an `'image_styles'` key in
your public field info (as shown above) with the list of styles to use and be
done with it.


## Reference fields and properties
It is considered a best practice to map a reference field (i.e. entity
reference or taxonomy term reference) or a reference property (e.g. the ``uid``
property on the node entity) to the resource it belongs to.

```php
public function publicFields() {
  $public_fields = parent::publicFields();
  // ...
  $public_fields['user'] = array(
    'property' => 'author',
    'resource' => array(
      // The bundle of the entity.
      'user' => array(
      // The name of the resource to map to.
      'name' => 'users',
      // Determines if the entire resource should appear, or only the ID.
      'fullView' => TRUE,
    ),
  );
  // ...
  return $public_fields;
}
```

Note that when you use the ``resource`` property, behind the scenes RESTful  
initializes a second handler and calls that resource. In order to pass information  
to the second handler (e.g. the access token), we pipe the original request  
array with some parameters removed. If you need to strip further parameters you can
override ``\RestfulBase::getRequestForSubRequest``.

## Output formats
The RESTful module outputs all resources by using HAL+JSON encoding by default.
That means that when you have the following data:

```php
array(
  array(
    'id' => 2,
    'label' => 'another title',
    'self' => 'https://example.com/node/2',
  ),
  array(
    'id' => 1,
    'label' => 'example title',
    'self' => 'https://example.com/node/1',
  ),
);
```

Then the following output is generated (using the header
`ContentType:application/hal+json; charset=utf-8`):

```javascript
{
  "data": [
    {
      "id": 2,
      "label": "another title",
      "self": "https:\/\/example.com\/node\/2"
    },
    {
      "id": 1,
      "label": "example title",
      "self": "https:\/\/example.com\/node\/1"
    }
  ],
  "count": 2,
  "_links": []
}
```

You can change that to be anything that you need. You have a plugin that will
allow you to output XML instead of JSON in
[the example module](./modules/restful_example/plugins/formatter). Take that
example and create you custom module that contains the formatter plugin the you
need (maybe you need to output JSON but following a different data structure,
you may even want to use YAML, ...). All that you will need is to create a
formatter plugin and tell your restful resource to use that in the restful
plugin definition:

```php
$plugin = array(
  'label' => t('Articles'),
  'resource' => 'articles',
  'description' => t('Export the article content type in my cool format.'),
  ...
  'formatter' => 'my_formatter', // <-- The name of the formatter plugin.
);
```


### Changing the default output format
If you need to change the output format for everything at once then you just
have to set a special variable with the name of the new output format plugin.
When you do that all the resources that don't specify a `'formatter'` key in the
plugin definition will use that output format by default. Ex:

```php
variable_set('restful_default_output_formatter', 'my_formatter');
```


## Render cache
In addition to providing its own basic caching, the RESTful module is compatible
 with the [Entity Cache](https://drupal.org/project/entitycache) module. Two
 requests made by the same user requesting the same fields on the same entity
 will benefit from the render cache layer. This means that no entity will need
 to be loaded if it was rendered in the past under the same conditions.

Developers have absolute control where the cache is stored and the expiration
for every resource, meaning that very volatile resources can skip cache entirely
while other resources can have its cache in MemCached or the database. To
configure this developers just have to specify the following keys in their
_restful_ plugin definition:

```php
$plugin = array(
  ...
  'render_cache' => array(
    // Enables the render cache.
    'render' => TRUE,
    // Defaults to 'cache_restful' (optional).
    'bin' => 'cache_bin_name',
    // Expiration logic. Defaults to CACHE_PERMANENT (optional).
    'expire' => CACHE_TEMPORARY,
    // Enable cache invalidation for entity based resources. Defaults to TRUE (optional).
    'simpleInvalidate' => TRUE,
    // Use a different cache backend for this resource. Defaults to variable_get('cache_default_class', 'DrupalDatabaseCache') (optional).
    'class' => 'MemCacheDrupal',
    // Account cache granularity. Instead of caching per user you can choose to cache per role. Default: DRUPAL_CACHE_PER_USER.
    'granularity' => DRUPAL_CACHE_PER_ROLE,
  ),
);
```

Additionally you can define a cache backend for a given cache bin by setting the
 variable `cache_class_<cache-bin-name>` to the class to be used. This way all
the resouces caching to that particular bin will use that cache backend instead
of the default one.


## Rate limit
RESTful provides rate limit functionality out of the box. A rate limit is a way
to protect your API service from flooding, basically consisting on checking is
the number of times an event has happened in a given period is greater that the
maximum allowed.


### Rate limit events
You can define your own rate limit events for your resources and define the
limit an period for those, for that you only need to create a new _rate\_limit_
CTools plugin and implement the `isRequestedEvent` method. Every request the
`isRequestedEvent` will be evaluated and if it returns true that request will
increase the number of hits -for that particular user- for that event. If the
number of hits is bigger than the allowed limit an exception will be raised.

Two events are provided out of the box: the request event -that is always true
for every request- and the global event -that is always true and is not
contained for a given resource, all resources will increment the hit counter-.

This way, for instance, you could define different limit for read operations
than for write operations by checking the HTTP method in `isRequestedEvent`.


### Configuring your rate limits
You can configure the declared Rate Limit events in every resource by providing
a configuration array. The following is taken from the example resource articles
1.4 (articles\_\_1\_4.inc):

```php
…
  'rate_limit' => array(
    // The 'request' event is the basic event. You can declare your own events.
    'request' => array(
      'event' => 'request',
      // Rate limit is cleared every day.
      'period' => new \DateInterval('P1D'),
      'limits' => array(
        'authenticated user' => 3,
        'anonymous user' => 2,
        'administrator' => \Drupal\restful\RateLimit\RateLimitManager::UNLIMITED_RATE_LIMIT,
      ),
    ),
  ),
…
```

As you can see in the example you can set the rate limit differently depending
on the role of the visiting user.

Since the global event is not tied to any resource the limit and period is
specified by setting the following variables:
  - `restful_global_rate_limit`: The number of allowed hits. This is global for
    all roles.
  - `restful_global_rate_period`: The period string compatible with
    \DateInterval.



## Documenting your resources.
A resource can be documented in the plugin definition using the `'label'`
and `'description'` keys:

```php
$plugin = array(
  // This is the human readable name of the resource.
  'label' => t('User'),
  // Use de description to provide more extended information about the resource.
  'description' => t('Export the "User" entity.'),
  'resource' => 'users',
  'class' => 'RestfulEntityBaseUser',
  ...
);
```

This should not include any information about the endpoints or the allowed HTTP
methods on them, since those will be accessed directly on the aforementioned
endpoint. This information aims to describe what the accessed resource
represents.

To access this information just use the `discovery` resource at the api
homepage:

```shell
# List resources
curl -u user:password https://example.org/api
```


================================================
FILE: help/problem-instances-bad-request.html
================================================
<h2>Malformed syntax.</h2>
  <p>The request could not be understood by the server due to malformed syntax.
  </p>


================================================
FILE: help/problem-instances-flood.html
================================================
<h2>Rate limit exceeded.</h2>
  <p>The user has sent too many requests in a given amount of time. Intended for
    use with rate limiting schemes.</p>


================================================
FILE: help/problem-instances-forbidden.html
================================================
<h2>Forbidden resource access.</h2>
  <p>The request was a valid request, but the server is refusing to respond to
    it. Unlike a 401 Unauthorized response, authenticating will make no
    difference.</p>


================================================
FILE: help/problem-instances-gone.html
================================================
<h2>Resource no longer available.</h2>
  <p>Indicates that the resource requested is no longer available and will not
    be available again. This should be used when a resource has been
    intentionally removed and the resource should be purged. Upon receiving a
    410 status code, the client should not request the resource again in the
    future. Clients such as search engines should remove the resource from their
    indices. Most use cases do not require clients and search engines to purge
    the resource, and a "404 Not Found" may be used instead.</p>


================================================
FILE: help/problem-instances-incompatible-field-definition.html
================================================
<h2>Incompatible field definition.</h2>
  <p>The field configuration contains incompatible or conflicting field definitions. Please make sure to read the
      documentation on how to declare your resource fields.</p>


================================================
FILE: help/problem-instances-not-found.html
================================================
<h2>Document not found.</h2>
  <p>The requested resource could not be found but may be available again in the
    future. Subsequent requests by the client are permissible.</p>


================================================
FILE: help/problem-instances-not-implemented.html
================================================
<h2>Operation not supported.</h2>
  <p>This error means that the operation you are attempting on the selected
    resource is not implemented in the server. If you think this operation
    should be supported, contact the support team.</p>


================================================
FILE: help/problem-instances-server-configuration.html
================================================
<h2>Server configuration error.</h2>
  <p>Some configuration for the RESTful module is causing an unrecoverable
    error. Please check your configuration.</p>


================================================
FILE: help/problem-instances-server-error.html
================================================
<h2>Internal server error exception.</h2>
  <p>Generic exception thrown when there is an error in the server side.</p>


================================================
FILE: help/problem-instances-service-unavailable.html
================================================
<h2>Server is unavailable.</h2>
  <p>The server is currently unavailable (because it is overloaded or down for
    maintenance). Generally, this is a temporary state.</p>


================================================
FILE: help/problem-instances-unauthorized.html
================================================
<h2>Authentication needed.</h2>
  <p>Similar to 403 Forbidden, but specifically for use when authentication is
    required and has failed or has not yet been provided. The response must
    include a WWW-Authenticate header field containing a challenge applicable to
    the requested resource. See the authentication methods documentation for
    more information.</p>


================================================
FILE: help/problem-instances-unprocessable-entity.html
================================================
<h2>Semantic error.</h2>
  <p>The request was well-formed but was unable to be followed due to semantic
    errors.</p>


================================================
FILE: help/problem-instances-unsupported-media-type.html
================================================
<h2>Type not supported by the server.</h2>
  <p>The request entity has a media type which the server or resource does not
    support. For example, the client uploads an image as image/svg+xml, but the
    server requires that images use a different format.</p>


================================================
FILE: help/problem-instances.html
================================================
<h2>Index</h2>


================================================
FILE: help/readme.html
================================================
Go to the <a href="https://github.com/Gizra/restful">project page</a> in GitHub.


================================================
FILE: help/restful.help.ini
================================================
[advanced help settings]
line break = TRUE

[readme]
title = README
weight = -10

[problem-instances]
title = RESTful problem instances
weight = 0

[problem-instances-bad-request]
title = Bad Request
weight = -90
parent = problem-instances

[problem-instances-flood]
title = Flood
weight = -80
parent = problem-instances

[problem-instances-forbidden]
title = Bad Request
weight = -70
parent = problem-instances

[problem-instances-gone]
title = Gone
weight = -60
parent = problem-instances

[problem-instances-service-unavailable]
title = Service unavailable
weight = -55
parent = problem-instances

[problem-instances-unauthorized]
title = Unauthorized
weight = -50
parent = problem-instances

[problem-instances-unprocessable-entity]
title = Unprocessable entity
weight = -40
parent = problem-instances

[problem-instances-unsupported-media-type]
title = Unsupported media type
weight = -30
parent = problem-instances



================================================
FILE: modules/restful_example/restful_example.info
================================================
name = RESTful example
description = Example module for the RESTful module.
core = 7.x
dependencies[] = restful

registry_autoload[] = PSR-0
registry_autoload[] = PSR-4


================================================
FILE: modules/restful_example/restful_example.module
================================================
<?php

/**
 * @file
 * Example module for the RESTful module.
 */


================================================
FILE: modules/restful_example/src/Plugin/formatter/FormatterHalXml.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Plugin\formatter\FormatterHalJson.
 */

namespace Drupal\restful_example\Plugin\formatter;

use Drupal\restful\Plugin\formatter\FormatterHalJson;
use Drupal\restful\Plugin\formatter\FormatterInterface;

/**
 * Class FormatterHalXml
 * @package Drupal\restful\Plugin\formatter
 *
 * @Formatter(
 *   id = "hal_xml",
 *   label = "HAL+XML",
 *   description = "Output in using the HAL conventions and XML format.",
 *   curie = {
 *     "name": "hal",
 *     "path": "doc/rels",
 *     "template": "/{rel}",
 *   },
 * )
 */
class FormatterHalXml extends FormatterHalJson implements FormatterInterface {

  /**
   * Content Type
   *
   * @var string
   */
  protected $contentType = 'application/xml; charset=utf-8';

  /**
   * {@inheritdoc}
   */
  public function render(array $structured_data) {
    return $this->arrayToXML($structured_data, new \SimpleXMLElement('<api/>'))->asXML();
  }

  /**
   * Converts the input array into an XML formatted string.
   *
   * @param array $data
   *   The input array.
   * @param \SimpleXMLElement $xml
   *   The object that will perform the conversion.
   *
   * @return \SimpleXMLElement
   */
  protected function arrayToXML(array $data, \SimpleXMLElement $xml) {
    foreach ($data as $key => $value) {
      if(is_array($value)) {
        if(!is_numeric($key)){
          $subnode = $xml->addChild("$key");
          $this->arrayToXML($value, $subnode);
        }
        else{
          $subnode = $xml->addChild("item$key");
          $this->arrayToXML($value, $subnode);
        }
      }
      else {
        $xml->addChild("$key", htmlspecialchars("$value"));
      }
    }
    return $xml;
  }

}


================================================
FILE: modules/restful_example/src/Plugin/resource/Tags__1_0.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_example\Plugin\resource\Tags__1_0.
 */

namespace Drupal\restful_example\Plugin\resource;

use Drupal\restful\Plugin\resource\DataInterpreter\DataInterpreterInterface;
use Drupal\restful\Plugin\resource\Field\ResourceFieldInterface;
use Drupal\restful\Plugin\resource\ResourceEntity;
use Drupal\restful\Plugin\resource\ResourceInterface;

/**
 * Class Tags
 * @package Drupal\restful\Plugin\resource
 *
 * @Resource(
 *   name = "tags:1.0",
 *   resource = "tags",
 *   label = "Tags",
 *   description = "Export the tags taxonomy term.",
 *   authenticationTypes = TRUE,
 *   authenticationOptional = TRUE,
 *   dataProvider = {
 *     "entityType": "taxonomy_term",
 *     "bundles": {
 *       "tags"
 *     },
 *   },
 *   majorVersion = 1,
 *   minorVersion = 0
 * )
 */
class Tags__1_0 extends ResourceEntity implements ResourceInterface {

  /**
   * Overrides ResourceEntity::checkEntityAccess().
   *
   * Allow access to create "Tags" resource for privileged users, as
   * we can't use entity_access() since entity_metadata_taxonomy_access()
   * denies it for a non-admin user.
   */
  protected function checkEntityAccess($op, $entity_type, $entity) {
    $account = $this->getAccount();
    return user_access('create article content', $account);
  }

}


================================================
FILE: modules/restful_example/src/Plugin/resource/comment/Comments__1_0.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_example\Plugin\resource\comment\Comments__1_0.
 */

namespace Drupal\restful_example\Plugin\resource\comment;

use Drupal\restful\Plugin\resource\ResourceEntity;
use Drupal\restful\Plugin\resource\ResourceInterface;

/**
 * Class Comments__1_0
 * @package Drupal\restful_example\Plugin\resource\comment
 *
 * @Resource(
 *   name = "comments:1.0",
 *   resource = "comments",
 *   label = "Comments",
 *   description = "Export the comments with all authentication providers.",
 *   authenticationTypes = TRUE,
 *   authenticationOptional = TRUE,
 *   dataProvider = {
 *     "entityType": "comment",
 *     "bundles": FALSE,
 *   },
 *   majorVersion = 1,
 *   minorVersion = 0
 * )
 */
class Comments__1_0 extends ResourceEntity implements ResourceInterface {

  /**
   * {@inheritdoc}
   */
  protected function publicFields() {
    $public_fields = parent::publicFields();

    $public_fields['nid'] = array(
      'property' => 'node',
      'sub_property' => 'nid',
    );

    // Add a custom field for test only.
    if (field_info_field('comment_text')) {
      $public_fields['comment_text'] = array(
        'property' => 'comment_text',
        'sub_property' => 'value',
      );
    }

    return $public_fields;
  }

  /**
   * {@inheritdoc}
   */
  protected function dataProviderClassName() {
    return '\Drupal\restful_example\Plugin\resource\comment\DataProviderComment';
  }

}


================================================
FILE: modules/restful_example/src/Plugin/resource/comment/DataProviderComment.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_example\Plugin\resource\comment\DataProviderComment.
 */

namespace Drupal\restful_example\Plugin\resource\comment;

use Drupal\restful\Plugin\resource\DataProvider\DataProviderEntity;
use Drupal\restful\Plugin\resource\DataProvider\DataProviderInterface;

class DataProviderComment  extends DataProviderEntity implements DataProviderInterface {

  /**
   * Overrides DataProviderEntity::setPropertyValues().
   *
   * Set nid and node type to a comment.
   *
   * Note that to create a comment with 'post comments' permission, apply a
   * patch on https://www.drupal.org/node/2236229
   */
  protected function setPropertyValues(\EntityDrupalWrapper $wrapper, $object, $replace = FALSE) {
    $comment = $wrapper->value();
    if (empty($comment->nid) && !empty($object['nid'])) {
      // Comment nid must be set manually, as the nid property setter requires
      // 'administer comments' permission.
      $comment->nid = $object['nid'];
      unset($object['nid']);

      // Make sure we have a bundle name.
      $node = node_load($comment->nid);
      $comment->node_type = 'comment_node_' . $node->type;
    }

    parent::setPropertyValues($wrapper, $object, $replace);
  }

  /**
   * Overrides DataProviderEntity::getQueryForList().
   *
   * Expose only published comments.
   */
  public function getQueryForList() {
    $query = parent::getQueryForList();
    $query->propertyCondition('status', COMMENT_PUBLISHED);
    return $query;
  }

  /**
   * Overrides DataProviderEntity::getQueryCount().
   *
   * Only count published comments.
   */
  public function getQueryCount() {
    $query = parent::getQueryCount();
    $query->propertyCondition('status', COMMENT_PUBLISHED);
    return $query;
  }

  /**
   * {@inheritdoc}
   */
  public function entityPreSave(\EntityDrupalWrapper $wrapper) {
    $comment = $wrapper->value();
    if (!empty($comment->cid)) {
      // Comment is already saved.
      return;
    }

    $comment->uid = $this->getAccount()->uid;
  }

}


================================================
FILE: modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_0.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_example\Plugin\resource\node\article\v1\Articles__1_0.
 */

namespace Drupal\restful_example\Plugin\resource\node\article\v1;

use Drupal\restful\Http\RequestInterface;
use Drupal\restful\Plugin\resource\ResourceEntity;
use Drupal\restful\Plugin\resource\ResourceInterface;
use Drupal\restful\Plugin\resource\ResourceNode;

/**
 * Class Articles
 * @package Drupal\restful\Plugin\resource
 *
 * @Resource(
 *   name = "articles:1.0",
 *   resource = "articles",
 *   label = "Articles",
 *   description = "Export the articles with all authentication providers.",
 *   authenticationTypes = TRUE,
 *   authenticationOptional = TRUE,
 *   dataProvider = {
 *     "entityType": "node",
 *     "bundles": {
 *       "article"
 *     },
 *   },
 *   majorVersion = 1,
 *   minorVersion = 0
 * )
 */
class Articles__1_0 extends ResourceNode implements ResourceInterface {}


================================================
FILE: modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_1.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_example\Plugin\resource\node\article\v1\Articles__1_1.
 */

namespace Drupal\restful_example\Plugin\resource\node\article\v1;

use Drupal\restful\Http\RequestInterface;
use Drupal\restful\Plugin\resource\ResourceEntity;
use Drupal\restful\Plugin\resource\ResourceInterface;

/**
 * Class Articles
 * @package Drupal\restful\Plugin\resource
 *
 * @Resource(
 *   name = "articles:1.1",
 *   resource = "articles",
 *   label = "Articles",
 *   description = "Export the article content type.",
 *   authenticationOptional = TRUE,
 *   dataProvider = {
 *     "entityType": "node",
 *     "bundles": {
 *       "article"
 *     },
 *   },
 *   majorVersion = 1,
 *   minorVersion = 1
 * )
 */
class Articles__1_1 extends Articles__1_0 implements ResourceInterface {

  /**
   * {@inheritdoc}
   */
  protected function publicFields() {
    $public_fields = parent::publicFields();
    unset($public_fields['self']);

    return $public_fields;
  }

}


================================================
FILE: modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_4.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_example\Plugin\resource\node\article\v1\Articles__1_4.
 */

namespace Drupal\restful_example\Plugin\resource\node\article\v1;

use Drupal\restful\Plugin\resource\ResourceInterface;
use Drupal\restful\Plugin\resource\ResourceNode;
use Drupal\restful\RateLimit\RateLimitManager;

/**
 * Class Articles__1_4
 * @package Drupal\restful\Plugin\resource
 *
 * @Resource(
 *   name = "articles:1.4",
 *   resource = "articles",
 *   label = "Articles",
 *   description = "Export the articles with all authentication providers.",
 *   authenticationTypes = TRUE,
 *   authenticationOptional = TRUE,
 *   dataProvider = {
 *     "entityType": "node",
 *     "bundles": {
 *       "article"
 *     },
 *   },
 *   majorVersion = 1,
 *   minorVersion = 4
 * )
 */
class Articles__1_4 extends ResourceNode implements ResourceInterface {

  /**
   * Constructs an Articles__1_4 object.
   *
   * @param array $configuration
   *   A configuration array containing information about the plugin instance.
   * @param string $plugin_id
   *   The plugin_id for the plugin instance.
   * @param mixed $plugin_definition
   *   The plugin implementation definition.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->pluginDefinition['rateLimit'] = array(
      // The 'request' event is the basic event. You can declare your own
      // events.
      'request' => array(
        'event' => 'request',
        // Rate limit is cleared every day.
        'period' => 'P1D',
        'limits' => array(
          'authenticated user' => 3,
          'anonymous user' => 2,
          'administrator' => RateLimitManager::UNLIMITED_RATE_LIMIT,
        ),
      ),
    );
  }

}


================================================
FILE: modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_5.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_example\Plugin\resource\node\article\v1\Articles__1_5.
 */

namespace Drupal\restful_example\Plugin\resource\node\article\v1;

use Drupal\restful\Plugin\resource\DataInterpreter\DataInterpreterInterface;
use Drupal\restful\Plugin\resource\Field\ResourceFieldBase;
use Drupal\restful\Plugin\resource\ResourceInterface;
use Drupal\restful\Plugin\resource\ResourceNode;

/**
 * Class Articles__1_5
 * @package Drupal\restful\Plugin\resource
 *
 * @Resource(
 *   name = "articles:1.5",
 *   resource = "articles",
 *   label = "Articles",
 *   description = "Export the articles with all authentication providers.",
 *   authenticationTypes = TRUE,
 *   authenticationOptional = TRUE,
 *   dataProvider = {
 *     "entityType": "node",
 *     "bundles": {
 *       "article"
 *     },
 *   },
 *   majorVersion = 1,
 *   minorVersion = 5
 * )
 */
class Articles__1_5 extends ResourceNode implements ResourceInterface {

  /**
   * Overrides ResourceNode::publicFields().
   */
  protected function publicFields() {
    $public_fields = parent::publicFields();

    $public_fields['body'] = array(
      'property' => 'body',
      'sub_property' => 'value',
    );

    $public_fields['tags'] = array(
      'property' => 'field_tags',
      'resource' => array(
        'name' => 'tags',
        'majorVersion' => 1,
        'minorVersion' => 0,
      ),
    );

    $public_fields['image'] = array(
      'property' => 'field_image',
      'process_callbacks' => array(
        array($this, 'imageProcess'),
      ),
      'image_styles' => array('thumbnail', 'medium', 'large'),
    );

    // By checking that the field exists, we allow re-using this class on
    // different tests, where different fields exist.
    if (field_info_field('field_images')) {
      $public_fields['images'] = array(
        'property' => 'field_images',
        'process_callbacks' => array(
          array($this, 'imageProcess'),
        ),
        'image_styles' => array('thumbnail', 'medium', 'large'),
      );
    }

    $public_fields['user'] = array(
      'property' => 'author',
      'resource' => array(
        // The name of the resource to map to.
        'name' => 'users',
        // Determines if the entire resource should appear, or only the ID.
        'fullView' => TRUE,
        'majorVersion' => 1,
        'minorVersion' => 0,
      ),
    );

    $public_fields['static'] = array(
      'callback' => '\Drupal\restful_example\Plugin\resource\node\article\v1\Articles__1_5::randomNumber',
    );

    return $public_fields;
  }

  /**
   * Process callback, Remove Drupal specific items from the image array.
   *
   * @param array $value
   *   The image array.
   *
   * @return array
   *   A cleaned image array.
   */
  public function imageProcess($value) {
    if (ResourceFieldBase::isArrayNumeric($value)) {
      $output = array();
      foreach ($value as $item) {
        $output[] = $this->imageProcess($item);
      }
      return $output;
    }
    return array(
      'id' => $value['fid'],
      'self' => file_create_url($value['uri']),
      'filemime' => $value['filemime'],
      'filesize' => $value['filesize'],
      'width' => $value['width'],
      'height' => $value['height'],
      'styles' => $value['image_styles'],
    );
  }

  /**
   * Callback, Generate a random number.
   *
   * @param DataInterpreterInterface $interpreter
   *   The data interpreter containing the wrapper.
   *
   * @return int
   *   A random integer.
   */
  public static function randomNumber(DataInterpreterInterface $interpreter) {
    return mt_rand();
  }

}


================================================
FILE: modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_6.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_example\Plugin\resource\node\article\v1\Articles__1_6.
 */

namespace Drupal\restful_example\Plugin\resource\node\article\v1;

use Drupal\restful\Plugin\resource\ResourceInterface;
use Drupal\restful\Plugin\resource\ResourceNode;

/**
 * Class Articles__1_6
 * @package Drupal\restful\Plugin\resource
 *
 * @Resource(
 *   name = "articles:1.6",
 *   resource = "articles",
 *   label = "Articles",
 *   description = "Export the articles with all authentication providers.",
 *   authenticationTypes = TRUE,
 *   authenticationOptional = TRUE,
 *   dataProvider = {
 *     "entityType": "node",
 *     "bundles": {
 *       "article"
 *     },
 *   },
 *   formatter = "hal_xml",
 *   majorVersion = 1,
 *   minorVersion = 6
 * )
 */
class Articles__1_6 extends ResourceNode implements ResourceInterface {

  /**
   * Overrides ResourceNode::publicFields().
   */
  protected function publicFields() {
    $public_fields = parent::publicFields();

    $public_fields['body'] = array(
      'property' => 'body',
      'sub_property' => 'value',
    );

    return $public_fields;
  }


}


================================================
FILE: modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_7.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_example\Plugin\resource\node\article\v1\Articles__1_7.
 */

namespace Drupal\restful_example\Plugin\resource\node\article\v1;

use Drupal\restful\Plugin\resource\ResourceInterface;
use Drupal\restful\Plugin\resource\ResourceNode;

/**
 * Class Articles__1_7
 * @package Drupal\restful\Plugin\resource
 *
 * @Resource(
 *   name = "articles:1.7",
 *   resource = "articles",
 *   label = "Articles",
 *   description = "Export the article content type using view modes.",
 *   authenticationTypes = TRUE,
 *   authenticationOptional = TRUE,
 *   dataProvider = {
 *     "entityType": "node",
 *     "bundles": {
 *       "article"
 *     },
 *     "viewMode" = {
 *       "name": "default",
 *       "fieldMap": {
 *         "body": "body",
 *         "field_tags": "tags",
 *         "field_image": "image",
 *       }
 *     }
 *   },
 *   majorVersion = 1,
 *   minorVersion = 7
 * )
 */
class Articles__1_7 extends ResourceNode implements ResourceInterface {}


================================================
FILE: modules/restful_example/src/Plugin/resource/node/article/v2/Articles__2_0.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_example\Plugin\resource\node\article\v2\Articles__2_0.
 */

namespace Drupal\restful_example\Plugin\resource\node\article\v2;

use Drupal\restful\Plugin\resource\ResourceInterface;
use Drupal\restful\Plugin\resource\ResourceNode;

/**
 * Class Articles
 * @package Drupal\restful\Plugin\resource
 *
 * @Resource(
 *   name = "articles:2.0",
 *   resource = "articles",
 *   label = "Articles",
 *   description = "Export the article content type.",
 *   authenticationOptional = TRUE,
 *   dataProvider = {
 *     "entityType": "node",
 *     "bundles": {
 *       "article"
 *     },
 *   },
 *   majorVersion = 2,
 *   minorVersion = 0
 * )
 */
class Articles__2_0 extends ResourceNode implements ResourceInterface {}


================================================
FILE: modules/restful_example/src/Plugin/resource/node/article/v2/Articles__2_1.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_example\Plugin\resource\node\article\v2\Articles__2_1.
 */

namespace Drupal\restful_example\Plugin\resource\node\article\v2;

use Drupal\restful\Plugin\resource\ResourceInterface;
use Drupal\restful\Plugin\resource\ResourceNode;

/**
 * Class Articles
 * @package Drupal\restful\Plugin\resource
 *
 * @Resource(
 *   name = "articles:2.1",
 *   resource = "articles",
 *   label = "Articles",
 *   description = "Export the article content type.",
 *   authenticationOptional = TRUE,
 *   dataProvider = {
 *     "entityType": "node",
 *     "bundles": {
 *       "article"
 *     },
 *     "idField": "custom-uuid"
 *   },
 *   formatter = "json_api",
 *   majorVersion = 2,
 *   minorVersion = 1
 * )
 */
class Articles__2_1 extends ResourceNode implements ResourceInterface {

  // TODO: Document the use of the idField.
  /**
   * {@inheritdoc}
   */
  protected function publicFields() {
    $fields = parent::publicFields();

    $fields['custom-uuid'] = array(
      'methods' => array(),
      'property' => 'uuid',
    );

    return $fields;
  }


}


================================================
FILE: modules/restful_example/src/Plugin/resource/variables/DataInterpreterVariable.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_example\Plugin\resource\variables\DataInterpreterVariable.
 */

namespace Drupal\restful_example\Plugin\resource\variables;

use Drupal\restful\Plugin\resource\DataInterpreter\DataInterpreterBase;

class DataInterpreterVariable extends DataInterpreterBase {}


================================================
FILE: modules/restful_example/src/Plugin/resource/variables/DataProviderVariable.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_example\Plugin\resource\variables\DataProviderVariable.
 */

namespace Drupal\restful_example\Plugin\resource\variables;

use Drupal\restful\Exception\BadRequestException;
use Drupal\restful\Exception\InaccessibleRecordException;
use Drupal\restful\Exception\UnprocessableEntityException;
use Drupal\restful\Http\RequestInterface;
use Drupal\restful\Plugin\resource\DataInterpreter\ArrayWrapper;
use Drupal\restful\Plugin\resource\DataProvider\DataProvider;
use Drupal\restful\Plugin\resource\DataProvider\DataProviderInterface;
use Drupal\restful\Plugin\resource\Field\ResourceFieldCollectionInterface;

/**
 * Class DataProviderVariable.
 *
 * @package Drupal\restful_example\Plugin\resource\variables
 */
class DataProviderVariable extends DataProvider implements DataProviderInterface {

  /**
   * {@inheritdoc}
   */
  public function __construct(RequestInterface $request, ResourceFieldCollectionInterface $field_definitions, $account, $plugin_id, $resource_path = NULL, array $options = array(), $langcode = NULL) {
    parent::__construct($request, $field_definitions, $account, $plugin_id, $resource_path, $options, $langcode);
    if (empty($this->options['urlParams'])) {
      $this->options['urlParams'] = array(
        'filter' => TRUE,
        'sort' => TRUE,
        'fields' => TRUE,
      );
    }
  }

  /**
   * {@inheritdoc}
   */
  public function count() {
    return count($this->getIndexIds());
  }

  /**
   * {@inheritdoc}
   */
  public function create($object) {
    // Overly simplified update method. Search for the name and value fields,
    // and set the variable.
    $name_key = $this->searchPublicFieldByProperty('name');
    $value_key = $this->searchPublicFieldByProperty('value');
    if (empty($object[$name_key]) || empty($object[$value_key])) {
      throw new BadRequestException('You need to provide the variable name and value.');
    }
    $identifier = $object[$name_key];
    if (!empty($GLOBALS['conf'][$identifier])) {
      throw new UnprocessableEntityException('The selected variable already exists.');
    }
    variable_set($identifier, $object[$value_key]);
    return array($this->view($identifier));
  }

  /**
   * {@inheritdoc}
   */
  public function view($identifier) {
    $resource_field_collection = $this->initResourceFieldCollection($identifier);

    $input = $this->getRequest()->getParsedInput();
    $limit_fields = !empty($input['fields']) ? explode(',', $input['fields']) : array();

    foreach ($this->fieldDefinitions as $resource_field_name => $resource_field) {
      /* @var \Drupal\restful\Plugin\resource\Field\ResourceFieldInterface $resource_field */

      if ($limit_fields && !in_array($resource_field_name, $limit_fields)) {
        // Limit fields doesn't include this property.
        continue;
      }

      if (!$this->methodAccess($resource_field) || !$resource_field->access('view', $resource_field_collection->getInterpreter())) {
        // The field does not apply to the current method or has denied
        // access.
        continue;
      }

      $resource_field_collection->set($resource_field->id(), $resource_field);
    }
    return $resource_field_collection;
  }

  /**
   * {@inheritdoc}
   */
  public function viewMultiple(array $identifiers) {
    $return = array();
    foreach ($identifiers as $identifier) {
      try {
        $row = $this->view($identifier);
      }
      catch (InaccessibleRecordException $e) {
        $row = NULL;
      }
      $return[] = $row;
    }

    return array_values(array_filter($return));
  }

  /**
   * {@inheritdoc}
   */
  public function update($identifier, $object, $replace = FALSE) {
    // Overly simplified update method. Search for the name and value fields,
    // and set the variable.
    $name_key = $this->searchPublicFieldByProperty('name');
    $value_key = $this->searchPublicFieldByProperty('value');
    if (empty($object[$value_key])) {
      if (!$replace) {
        return array($this->view($identifier));
      }
      $object[$value_key] = NULL;
    }
    if (!empty($object[$name_key]) && $object[$name_key] != $identifier) {
      // If the variable name is changed, then remove the old one.
      $this->remove($identifier);
      $identifier = $object[$name_key];
    }
    variable_set($identifier, $object[$value_key]);
    return array($this->view($identifier));
  }

  /**
   * {@inheritdoc}
   */
  public function remove($identifier) {
    variable_del($identifier);
  }

  /**
   * {@inheritdoc}
   */
  public function getIndexIds() {
    $output = array();
    foreach ($GLOBALS['conf'] as $key => $value) {
      $output[] = array('name' => $key, 'value' => $value);
    }
    // Apply filters.
    $output = $this->applyFilters($output);
    $output = $this->applySort($output);
    return array_map(function ($item) { return $item['name']; }, $output);
  }

  /**
   * Removes plugins from the list based on the request options.
   *
   * @param \Drupal\restful\Plugin\resource\ResourceInterface[] $variables
   *   The array of resource plugins keyed by instance ID.
   *
   * @return \Drupal\restful\Plugin\resource\ResourceInterface[]
   *   The same array minus the filtered plugins.
   *
   * @throws \Drupal\restful\Exception\BadRequestException
   * @throws \Drupal\restful\Exception\ServiceUnavailableException
   */
  protected function applyFilters(array $variables) {
    $filters = $this->parseRequestForListFilter();

    // Apply the filter to the list of plugins.
    foreach ($variables as $delta => $variable) {
      $variable_name = $variable['name'];
      // A filter on a result needs the ResourceFieldCollection representing the
      // result to return.
      $interpreter = $this->initDataInterpreter($variable_name);
      $this->fieldDefinitions->setInterpreter($interpreter);
      foreach ($filters as $filter) {
        if (!$this->fieldDefinitions->evalFilter($filter)) {
          unset($variables[$delta]);
        }
      }
    }
    $this->fieldDefinitions->setInterpreter(NULL);
    return $variables;
  }

  /**
   * Sorts plugins on the list based on the request options.
   *
   * @param \Drupal\restful\Plugin\resource\ResourceInterface[] $variables
   *   The array of resource plugins keyed by instance ID.
   *
   * @return \Drupal\restful\Plugin\resource\ResourceInterface[]
   *   The sorted array.
   *
   * @throws \Drupal\restful\Exception\BadRequestException
   * @throws \Drupal\restful\Exception\ServiceUnavailableException
   */
  protected function applySort(array $variables) {
    if ($sorts = $this->parseRequestForListSort()) {
      uasort($variables, function ($variable1, $variable2) use ($sorts) {
        $interpreter1 = $this->initDataInterpreter($variable1['name']);
        $interpreter2 = $this->initDataInterpreter($variable2['name']);
        foreach ($sorts as $key => $order) {
          $property = $this->fieldDefinitions->get($key)->getProperty();
          $value1 = $interpreter1->getWrapper()->get($property);
          $value2 = $interpreter2->getWrapper()->get($property);
          if ($value1 == $value2) {
            continue;
          }

          return ($order == 'DESC' ? -1 : 1) * strcmp($value1, $value2);
        }

        return 0;
      });
    }
    return $variables;
  }

  /**
   * {@inheritdoc}
   */
  protected function initDataInterpreter($identifier) {
    return new DataInterpreterVariable($this->getAccount(), new ArrayWrapper(array(
      'name' => $identifier,
      'value' => variable_get($identifier),
    )));
  }

  /**
   * Finds the public field name that has the provided property.
   *
   * @param string $property
   *   The property to find.
   *
   * @return string
   *   The name of the public name.
   */
  protected function searchPublicFieldByProperty($property) {
    foreach ($this->fieldDefinitions as $public_name => $resource_field) {
      if ($resource_field->getProperty() == $property) {
        return $public_name;
      }
    }
    return NULL;
  }

}


================================================
FILE: modules/restful_example/src/Plugin/resource/variables/DataProviderVariableInterface.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_example\Plugin\resource\variables\DataProviderVariableInterface.
 */

namespace Drupal\restful_example\Plugin\resource\variables;

use Drupal\restful\Plugin\resource\DataProvider\DataProviderInterface;

interface DataProviderVariableInterface extends DataProviderInterface {}


================================================
FILE: modules/restful_example/src/Plugin/resource/variables/Variables__1_0.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_example\Plugin\resource\variables\Variables__1_0.
 */

namespace Drupal\restful_example\Plugin\resource\variables;

use Drupal\restful\Plugin\resource\Resource;
use Drupal\restful\Plugin\resource\ResourceInterface;

/**
 * Class Variables
 * @package Drupal\restful\Plugin\resource
 *
 * @Resource(
 *   name = "variables:1.0",
 *   resource = "variables",
 *   label = "Variables",
 *   description = "Export the variables.",
 *   authenticationTypes = TRUE,
 *   authenticationOptional = TRUE,
 *   dataProvider = {
 *     "idField": "variable_name"
 *   },
 *   renderCache = {
 *     "render": true
 *   },
 *   majorVersion = 1,
 *   minorVersion = 0
 * )
 */
class Variables__1_0 extends Resource implements ResourceInterface {

  /**
   * {@inheritdoc}
   */
  protected function publicFields() {
    return array(
      'variable_name' => array('property' => 'name'),
      'variable_value' => array('property' => 'value'),
    );
  }

  /**
   * {@inheritdoc}
   */
  protected function dataProviderClassName() {
    return '\Drupal\restful_example\Plugin\resource\variables\DataProviderVariable';
  }

}


================================================
FILE: modules/restful_token_auth/modules/restful_token_auth_test/restful_token_auth_test.info
================================================
name = RESTful Token Authentication tests
description = Test module that provides some example resources.
core = 7.x

dependencies[] = restful_token_auth

registry_autoload[] = PSR-0
registry_autoload[] = PSR-4


================================================
FILE: modules/restful_token_auth/modules/restful_token_auth_test/restful_token_auth_test.module
================================================
<?php

/**
 * @file
 * Module implementation file.
 */


================================================
FILE: modules/restful_token_auth/modules/restful_token_auth_test/src/Plugin/resource/Articles__1_3.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_token_auth_test\Plugin\resource\Articles__1_3.
 */

namespace Drupal\restful_token_auth_test\Plugin\resource;

use Drupal\restful\Plugin\resource\ResourceInterface;
use Drupal\restful\Plugin\resource\ResourceNode;

/**
 * Class Articles__1_3
 * @package Drupal\restful\Plugin\resource
 *
 * @Resource(
 *   name = "articles:1.3",
 *   resource = "articles",
 *   label = "Articles",
 *   description = "Export the articles with all authentication providers.",
 *   authenticationTypes = {
 *     "token"
 *   },
 *   dataProvider = {
 *     "entityType": "node",
 *     "bundles": {
 *       "article"
 *     },
 *   },
 *   majorVersion = 1,
 *   minorVersion = 3
 * )
 */
class Articles__1_3 extends ResourceNode implements ResourceInterface {}


================================================
FILE: modules/restful_token_auth/restful_token_auth.admin.inc
================================================
<?php

/**
 * Menu callback; Admin settings form.
 */
function restful_token_auth_admin_settings($form, &$form_state) {
  $form['restful_token_auth_delete_expired_tokens'] = array(
    '#type' => 'checkbox',
    '#title' => t('Delete expired tokens.'),
    '#description' => t('Enable to delete expired tokens when trying to use an expired token and during cron runs.'),
    '#default_value' => variable_get('restful_token_auth_delete_expired_tokens', TRUE),
  );
  $form['advanced'] = array(
    '#type' => 'fieldset',
    '#title' => t('Advanced'),
    '#description' => t('Advanced configuration for the token authentication.'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['advanced']['restful_token_auth_expiration_period'] = array(
    '#type' => 'textfield',
    '#title' => t('Expiration time'),
    '#description' => t('The period string compatible with <a href="@url">\DateInterval</a>.', array('@url' => 'http://php.net/manual/en/class.dateinterval.php')),
    '#default_value' => variable_get('restful_token_auth_expiration_period', 'P1D'),
    '#element_validate' => array('restful_date_time_format_element_validate'),
  );

  return system_settings_form($form);
}


================================================
FILE: modules/restful_token_auth/restful_token_auth.info
================================================
name = RESTful token authentication
description = Authenticate a REST call using a token.
core = 7.x
dependencies[] = restful
dependencies[] = entityreference
configure = admin/config/services/restful/token-auth

registry_autoload[] = PSR-0
registry_autoload[] = PSR-4

files[] = tests/RestfulTokenAuthenticationTestCase.test


================================================
FILE: modules/restful_token_auth/restful_token_auth.install
================================================
<?php

/**
 * @file
 * Install, update, and uninstall functions for the RESTful token authentication
 * module.
 */

/**
 * Implements hook_schema().
 */
function restful_token_auth_schema() {
  $schema = array();
  $schema['restful_token_auth'] = array(
    'description' => 'The authentication token table.',
    'fields' => array(
      'id' => array(
        'description' => 'The authentication token unique ID.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'type' => array(
        'description' => 'The authentication token type.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'uid' => array(
        'description' => 'The user the authentication token belongs to.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'name' => array(
        'description' => 'The authentication token name.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'default' => '',
      ),
      'token' => array(
        'description' => 'The authentication token security token.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'created' => array(
        'description' => 'The Unix timestamp when the authentication token was created.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'expire' => array(
        'description' => 'The Unix timestamp when the authentication token will expire.',
        'type' => 'int',
        'not null' => FALSE,
        'default' => NULL,
      ),
    ),
    'foreign keys' => array(
      'uid' => array(
        'table' => 'users',
        'columns' => array('uid' => 'uid'),
      ),
    ),
    'primary key' => array('id'),
  );

  // Cache bins for Entity-cache module.
  $cache_schema = drupal_get_schema_unprocessed('system', 'cache');
  $types = array('restful_token_auth');

  foreach ($types as $type) {
    $schema["cache_entity_$type"] = $cache_schema;
    $schema["cache_entity_$type"]['description'] = "Cache table used to store $type entity records.";
  }

  return $schema;
}

/**
 * Implements hook_install().
 */
function restful_token_auth_install() {
  restful_token_auth_create_field_refresh_token();
}

/**
 * Implements hook_uninstall().
 */
function restful_token_auth_uninstall() {
  variable_del('restful_token_auth_delete_expired_tokens');
  field_delete_field('refresh_token_reference');
}

/**
 * Adds the refresh token entity reference.
 */
function restful_token_auth_update_7100(&$sandbox) {
  // Change the type column for existing tokens.
  db_update('restful_token_auth')
    ->fields(array(
      'type' => 'access_token',
    ))
    ->execute();

  // Attach the new field.
  restful_token_auth_create_field_refresh_token();
}

/**
 * Helper function to create the refresh token entity reference.
 */
function restful_token_auth_create_field_refresh_token() {
  // Add an entity reference field to the access_token bundle to link to the
  // corresponding refresh token.
  $field_name = 'refresh_token_reference';
  $field = array(
    'entity_types' => array('restful_token_auth'),
    'settings' => array(
      'handler' => 'base',
      'target_type' => 'restful_token_auth',
      'handler_settings' => array(
        'target_bundles' => array(
          'refresh_token' => 'refresh_token',
        ),
      ),
    ),
    'field_name' => $field_name,
    'type' => 'entityreference',
    'cardinality' => 1,
  );
  field_create_field($field);

  $instance = array(
    'field_name' => $field_name,
    'bundle' => 'access_token',
    'entity_type' => 'restful_token_auth',
    'label' => t('Refresh token'),
    'description' => t('Token used to get a new access token once it is expired.'),
    'required' => FALSE,
  );
  field_create_instance($instance);
}


================================================
FILE: modules/restful_token_auth/restful_token_auth.module
================================================
<?php

/**
 * @file
 * RESTful token authentication.
 */

use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\restful\Http\RequestInterface;
use Drupal\restful\Authentication\AuthenticationManager;
use Drupal\restful\Plugin\resource\ResourceInterface;

/**
 * Implements hook_menu().
 */
function restful_token_auth_menu() {
  // Add administration page.
  $items['admin/config/services/restful/token-auth'] = array(
    'title' => 'Token Authentication',
    'description' => 'Administer the RESTful Token Authentication module.',
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array('restful_token_auth_admin_settings'),
    'access arguments' => array('administer restful'),
    'file' => 'restful_token_auth.admin.inc',
  );
  return $items;
}

/**
 * Implements hook_restful_parse_request_alter().
 */
function restful_token_auth_restful_parse_request_alter(RequestInterface &$request) {
  // In this hook we cannot rely on the service to be ready.
  $authentication_manager = new AuthenticationManager();
  try {
    // If the the authentication provider have not been added yet, add it.
    $authentication_manager->addAuthenticationProvider('token');
    $plugin = $authentication_manager->getPlugin('token');
  }
  catch (PluginNotFoundException $e) {
    watchdog_exception('restful_token_auth', $e);
    return;
  }
  $plugin_definition = $plugin->getPluginDefinition();
  $param_name = $plugin_definition['options']['paramName'];

  $header = $request->getHeaders()->get($param_name);
  $request->setApplicationData($param_name, $header->getValueString());
}

/**
 * Implements hook_entity_info().
 */
function restful_token_auth_entity_info() {
  $items['restful_token_auth'] = array(
    'label' => t('Authentication token'),
    'entity class' => '\\Drupal\\restful_token_auth\\Entity\\RestfulTokenAuth',
    'controller class' => '\\Drupal\\restful_token_auth\\Entity\\RestfulTokenAuthController',
    'base table' => 'restful_token_auth',
    'fieldable' => TRUE,
    'entity keys' => array(
      'id' => 'id',
      'label' => 'name',
      'bundle' => 'type',
    ),
    'bundles' => array(
      'access_token' => array(
        'label' => t('Access token'),
      ),
      'refresh_token' => array(
        'label' => t('Refresh token'),
      ),
    ),
    'bundle keys' => array(
      'bundle' => 'type',
    ),
    'module' => 'restful_token_auth',
    'entity cache' => module_exists('entitycache'),
  );

  return $items;
}

/**
 * Implements hook_cron().
 *
 * Delete expired token auth entities.
 */
function restful_token_auth_cron() {
  if (!variable_get('restful_token_auth_delete_expired_tokens', TRUE)) {
    // We should not delete expired tokens.
    return;
  }

  $query = new \EntityFieldQuery();
  $result = $query
    ->entityCondition('entity_type', 'restful_token_auth')
    ->propertyCondition('expire', REQUEST_TIME, '<')
    ->range(0, 50)
    ->execute();

  if (empty($result['restful_token_auth'])) {
    // No expired tokens.
    return;
  }

  $ids = array_keys($result['restful_token_auth']);
  entity_delete_multiple('restful_token_auth', $ids);
}

/**
 * Implements hook_restful_resource_alter().
 */
function restful_token_auth_restful_resource_alter(ResourceInterface &$resource) {
  $plugin_definition = $resource->getPluginDefinition();
  if (
    empty($plugin_definition['dataProvider']['entityType']) ||
    $plugin_definition['dataProvider']['entityType'] != 'restful_token_auth' ||
    !empty($plugin_definition['formatter'])
  ) {
    return;
  }
  // If this resource is based on access token entities and does not have an
  // explicit formatter attached to it, then use the single_json formatter.
  $plugin_definition['formatter'] = 'single_json';
  $resource->setPluginDefinition($plugin_definition);
}

/**
 * Implements hook_user_update().
 */
function restful_token_auth_user_update(&$edit, $account, $category) {
  if ($edit['status']) {
    return;
  }

  $query = new EntityFieldQuery();
  $result = $query
    ->entityCondition('entity_type', 'restful_token_auth')
    ->propertyCondition('uid', $account->uid)
    ->execute();

  if (empty($result['restful_token_auth'])) {
      return;
  }

  entity_delete_multiple('restful_token_auth', array_keys($result['restful_token_auth']));
}


================================================
FILE: modules/restful_token_auth/src/Entity/RestfulTokenAuth.php
================================================
<?php

/**
 * @file
 * Contains Drupal\restful_token_auth\Entity\RestfulTokenAuth.
 */

namespace Drupal\restful_token_auth\Entity;

class RestfulTokenAuth extends \Entity {}


================================================
FILE: modules/restful_token_auth/src/Entity/RestfulTokenAuthController.php
================================================
<?php

/**
 * @file
 * Contains Drupal\restful_token_auth\Entity\RestfulTokenAuthController.
 */

namespace Drupal\restful_token_auth\Entity;

use Drupal\restful\Exception\ServerConfigurationException;

class RestfulTokenAuthController extends \EntityAPIController {

  /**
   * Create a new access_token entity with a referenced refresh_token.
   *
   * @param int $uid
   *   The user ID.
   *
   * @return RestfulTokenAuth
   *   The created entity.
   */
  public function generateAccessToken($uid) {
    $refresh_token = $this->generateRefreshToken($uid);
    // Create a new access token.
    $values = array(
      'uid' => $uid,
      'type' => 'access_token',
      'created' => REQUEST_TIME,
      'name' => t('Access token for: @uid', array(
        '@uid' => $uid,
      )),
      'token' => drupal_random_key(),
      'expire' => $this->getExpireTime(),
      'refresh_token_reference' => array(
        LANGUAGE_NONE => array(array(
          'target_id' => $refresh_token->id,
        )),
      ),
    );
    $access_token = $this->create($values);
    $this->save($access_token);

    return $access_token;
  }

  /**
   * Create a refresh token for the current user.
   *
   * It will delete all the existing refresh tokens for that same user as well.
   *
   * @param int $uid
   *   The user ID.
   *
   * @return RestfulTokenAuth
   *   The token entity.
   */
  private function generateRefreshToken($uid) {
    // Check if there are other refresh tokens for the user.
    $query = new \EntityFieldQuery();
    $results = $query
      ->entityCondition('entity_type', 'restful_token_auth')
      ->entityCondition('bundle', 'refresh_token')
      ->propertyCondition('uid', $uid)
      ->execute();

    if (!empty($results['restful_token_auth'])) {
      // Delete the tokens.
      entity_delete_multiple('restful_token_auth', array_keys($results['restful_token_auth']));
    }

    // Create a new refresh token.
    $values = array(
      'uid' => $uid,
      'type' => 'refresh_token',
      'created' => REQUEST_TIME,
      'name' => t('Refresh token for: @uid', array(
        '@uid' => $uid,
      )),
      'token' => drupal_random_key(),
    );
    $refresh_token = $this->create($values);
    $this->save($refresh_token);
    return $refresh_token;
  }

  /**
   * Return the expiration time.
   *
   * @throws ServerConfigurationException
   *
   * @return int
   *   Timestamp with the expiration time.
   */
  protected function getExpireTime() {
    $now = new \DateTime();
    try {
      $expiration = $now->add(new \DateInterval(variable_get('restful_token_auth_expiration_period', 'P1D')));
    }
    catch (\Exception $e) {
      throw new ServerConfigurationException('Invalid DateInterval format provided.');
    }
    return $expiration->format('U');
  }

}


================================================
FILE: modules/restful_token_auth/src/Plugin/authentication/TokenAuthentication.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful_token_auth\Plugin\authentication\TokenAuthentication
 */

namespace Drupal\restful_token_auth\Plugin\authentication;

use Drupal\restful\Http\RequestInterface;
use Drupal\restful\Plugin\authentication\Authentication;

/**
 * Class TokenAuthentication
 * @package Drupal\restful\Plugin\authentication
 *
 * @Authentication(
 *   id = "token",
 *   label = "Token based authentication",
 *   description = "Authenticate requests based on the token sent in the request.",
 *   options = {
 *     "paramName" = "access_token",
 *   },
 * )
 */
class TokenAuthentication extends Authentication {

  /**
   * {@inheritdoc}
   */
  public function applies(RequestInterface $request) {
    return (bool) $this->extractToken($request);
  }

  /**
   * {@inheritdoc}
   */
  public function authenticate(RequestInterface $request) {
    // Access token may be on the request, or in the headers.
    if (!$token = $this->extractToken($request)) {
      return NULL;
    }

    // Check if there is a token that has not expired yet.
    $query = new \EntityFieldQuery();
    $result = $query
      ->entityCondition('entity_type', 'restful_token_auth')
      ->entityCondition('bundle', 'access_token')
      ->propertyCondition('token', $token)
      ->range(0, 1)
      ->execute();


    if (empty($result['restful_token_auth'])) {
      // No token exists.
      return NULL;
    }

    $id = key($result['restful_token_auth']);
    $auth_token = entity_load_single('restful_token_auth', $id);

    if (!empty($auth_token->expire) && $auth_token->expire < REQUEST_TIME) {
      // Token is expired.

      if (variable_get('restful_token_auth_delete_expired_tokens', TRUE)) {
        // Token has expired, so we can delete this token.
        $auth_token->delete();
      }

      return NULL;
    }

    return user_load($auth_token->uid);
  }

  /**
   * Extract the token from the request.
   *
   * @param RequestInterface $request
   *   The request.
   *
   * @return string
   *   The extracted token.
   */
  protected function extractToken(RequestInterface $request) {
    $plugin_definition = $this->getPluginDefinition();
    $options = $plugin_definition['options'];
    $key_name = !empty($options['paramName']) ? $options['paramName'] : 'access_token';

    // Access token may be on the request, or in the headers.
    $input = $request->getParsedInput();

    // If we don't have a $key_name on either the URL or the in the headers,
    // then check again using a hyphen instead of an underscore. This is due to
    // new versions of Apache not accepting headers with underscores.
    if (empty($input[$key_name]) && !$request->getHeaders()->get($key_name)->getValueString()) {
      $key_name = str_replace('_', '-', $key_name);
    }

    return empty($input[$key_name]) ? $request->getHeaders()->get($key_name)->getValueString() : $input[$key_name];
  }

}


================================================
FILE: modules/restful_token_auth/src/Plugin/resource/AccessToken__1_0.php
================================================
<?php

/**
 * @file
 * Contains Drupal\restful_token_auth\Plugin\resource\AccessToken__1_0.
 */

namespace Drupal\restful_token_auth\Plugin\resource;

use Drupal\restful\Http\RequestInterface;
use Drupal\restful\Plugin\resource\ResourceInterface;
use Drupal\restful\Plugin\resource\DataProvider\DataProviderEntityInterface;

/**
 * Class AccessToken__1_0
 * @package Drupal\restful_token_auth\Plugin\resource
 *
 * @Resource(
 *   name = "access_token:1.0",
 *   resource = "access_token",
 *   label = "Access token authentication",
 *   description = "Export the access token authentication resource.",
 *   authenticationTypes = {
 *     "cookie",
 *     "basic_auth"
 *   },
 *   authenticationOptional = FALSE,
 *   dataProvider = {
 *     "entityType": "restful_token_auth",
 *     "bundles": {
 *       "access_token"
 *     },
 *   },
 *   formatter = "single_json",
 *   menuItem = "login-token",
 *   majorVersion = 1,
 *   minorVersion = 0
 * )
 */
class AccessToken__1_0 extends TokenAuthenticationBase implements ResourceInterface {

  /**
   * {@inheritdoc}
   */
  public function controllersInfo() {
    return array(
      '' => array(
        // Get or create a new token.
        RequestInterface::METHOD_GET => 'getOrCreateToken',
        RequestInterface::METHOD_OPTIONS => 'discover',
      ),
    );
  }

  /**
   * Create a token for a user, and return its value.
   */
  public function getOrCreateToken() {
    $entity_type = $this->getEntityType();
    $account = $this->getAccount();
    // Check if there is a token that did not expire yet.
    /* @var DataProviderEntityInterface $data_provider */
    $data_provider = $this->getDataProvider();
    $query = $data_provider->EFQObject();
    $result = $query
      ->entityCondition('entity_type', $entity_type)
      ->entityCondition('bundle', 'access_token')
      ->propertyCondition('uid', $account->uid)
      ->range(0, 1)
      ->execute();

    $token_exists = FALSE;

    if (!empty($result[$entity_type])) {
      $id = key($result[$entity_type]);
      $access_token = entity_load_single($entity_type, $id);

      $token_exists = TRUE;
      if (!empty($access_token->expire) && $access_token->expire < REQUEST_TIME) {
        if (variable_get('restful_token_auth_delete_expired_tokens', TRUE)) {
          // Token has expired, so we can delete this token.
          $access_token->delete();
        }

        $token_exists = FALSE;
      }
    }

    if (!$token_exists) {
      /* @var \Drupal\restful_token_auth\Entity\RestfulTokenAuthController $controller */
      $controller = entity_get_controller($this->getEntityType());
      $access_token = $controller->generateAccessToken($account->uid);
      $id = $access_token->id;
    }
    $output = $this->view($id);

    return $output;
  }

}


================================================
FILE: modules/restful_token_auth/src/Plugin/resource/RefreshToken__1_0.php
================================================
<?php

/**
 * @file
 * Contains Drupal\restful_token_auth\Plugin\resource\RefreshToken__1_0.
 */

namespace Drupal\restful_token_auth\Plugin\resource;


use Drupal\restful\Exception\BadRequestException;
use Drupal\restful\Http\RequestInterface;
use Drupal\restful\Plugin\resource\ResourceInterface;
use Drupal\restful\Util\EntityFieldQuery;
use Drupal\restful_token_auth\Entity\RestfulTokenAuth;

/**
 * Class RefreshToken__1_0
 * @package Drupal\restful_token_auth\Plugin\resource
 *
 * @Resource(
 *   name = "refresh_token:1.0",
 *   resource = "refresh_token",
 *   label = "Refresh token authentication",
 *   description = "Export the refresh token authentication resource.",
 *   authenticationOptional = TRUE,
 *   dataProvider = {
 *     "entityType": "restful_token_auth",
 *     "bundles": {
 *       "access_token"
 *     },
 *   },
 *   formatter = "single_json",
 *   menuItem = "refresh-token",
 *   majorVersion = 1,
 *   minorVersion = 0
 * )
 */
class RefreshToken__1_0 extends TokenAuthenticationBase implements ResourceInterface {

  /**
   * Overrides \RestfulBase::controllersInfo().
   */
  public function controllersInfo() {
    return array(
      '.*' => array(
        // Get or create a new token.
        RequestInterface::METHOD_GET => 'refreshToken',
      ),
    );
  }

  /**
   * Create a token for a user, and return its value.
   *
   * @param string $token
   *   The refresh token.
   *
   * @throws BadRequestException
   *
   * @return RestfulTokenAuth
   *   The new access token.
   */
  public function refreshToken($token) {
    // Check if there is a token that did not expire yet.
    /* @var \Drupal\restful\Plugin\resource\DataProvider\DataProviderEntityInterface $data_provider */
    $data_provider = $this->getDataProvider();
    $query = $data_provider->EFQObject();
    $results = $query
      ->entityCondition('entity_type', $this->entityType)
      ->entityCondition('bundle', 'refresh_token')
      ->propertyCondition('token', $token)
      ->range(0, 1)
      ->execute();

    if (empty($results['restful_token_auth'])) {
      throw new BadRequestException('Invalid refresh token.');
    }

    // Remove the refresh token once used.
    $refresh_token = entity_load_single('restful_token_auth', key($results['restful_token_auth']));
    $uid = $refresh_token->uid;

    // Get the access token linked to this refresh token then do some cleanup.
    $access_token_query = new EntityFieldQuery();
    $access_token_reference = $access_token_query
      ->entityCondition('entity_type', 'restful_token_auth')
      ->entityCondition('bundle', 'access_token')
      ->fieldCondition('refresh_token_reference', 'target_id', $refresh_token->id)
      ->range(0, 1)
      ->execute();

    if (!empty($access_token_reference['restful_token_auth'])) {
      $access_token = key($access_token_reference['restful_token_auth']);
      entity_delete('restful_token_auth', $access_token);
    }

    $refresh_token->delete();

    // Create the new access token and return it.
    /* @var \Drupal\restful_token_auth\Entity\RestfulTokenAuthController $controller */
    $controller = entity_get_controller($this->getEntityType());
    $token = $controller->generateAccessToken($uid);
    return $this->view($token->id);
  }

}


================================================
FILE: modules/restful_token_auth/src/Plugin/resource/TokenAuthenticationBase.php
================================================
<?php
/**
 * @file
 * Contains Drupal\restful_token_auth\Plugin\resource\TokenAuthenticationBase.
 */

namespace Drupal\restful_token_auth\Plugin\resource;


use Drupal\restful\Plugin\resource\ResourceEntity;
use Drupal\restful\Plugin\resource\ResourceInterface;

abstract class TokenAuthenticationBase extends ResourceEntity implements ResourceInterface {

  /**
   * Overrides ResourceEntity::publicFields().
   *
   * @see http://tools.ietf.org/html/rfc6750#section-4
   */
  public function publicFields() {
    $public_fields = parent::publicFields();
    unset($public_fields['label']);
    unset($public_fields['self']);
    $public_fields['id']['methods'] = array();
    $public_fields['access_token'] = array(
      'property' => 'token',
    );
    $public_fields['type'] = array(
      'callback' => array('\Drupal\restful\RestfulManager::echoMessage', array('Bearer')),
    );
    $public_fields['expires_in'] = array(
      'property' => 'expire',
      'process_callbacks' => array(
        '\Drupal\restful_token_auth\Plugin\resource\TokenAuthenticationBase::intervalInSeconds',
      ),
    );
    $public_fields['refresh_token'] = array(
      'property' => 'refresh_token_reference',
      'process_callbacks' => array(
        '\Drupal\restful_token_auth\Plugin\resource\TokenAuthenticationBase::getTokenFromEntity',
      ),
    );

    return $public_fields;
  }

  /**
   * Process callback helper to get the time difference in seconds.
   *
   * @param int $value
   *   The expiration timestamp in the access token.
   *
   * @return int
   *   Number of seconds before expiration.
   */
  public static function intervalInSeconds($value) {
    $interval = $value - time();
    return $interval < 0 ? 0 : $interval;
  }

  /**
   * Get the token string from the token entity.
   *
   * @param int $token_id
   *   The restful_token_auth entity.
   *
   * @return string
   *   The token string.
   */
  public static function getTokenFromEntity($token_id) {
    if ($token = entity_load_single('restful_token_auth', $token_id)) {
      return $token->token;
    }
    return NULL;
  }

}


================================================
FILE: modules/restful_token_auth/tests/RestfulTokenAuthenticationTestCase.test
================================================
<?php

/**
 * @file
 * Contains RestfulTokenAuthenticationTestCase.
 */

use Drupal\restful\Exception\BadRequestException;
use Drupal\restful\Exception\UnauthorizedException;
use Drupal\restful\Http\Request;

class RestfulTokenAuthenticationTestCase extends DrupalWebTestCase {

  /**
   * {@inheritdoc}
   */
  public static function getInfo() {
    return array(
      'name' => 'Token Authentication',
      'description' => 'Test the request authentication with a token.',
      'group' => 'RESTful',
    );
  }

  /**
   * {@inheritdoc}
   */
  public function setUp() {
    parent::setUp('restful_example', 'restful_token_auth', 'restful_token_auth_test');

    $this->user = $this->drupalCreateUser();
  }

  /**
   * Testing the user's access token will be invalidate one the user is blocked.
   */
  function testTokenInvalidating() {
    $this->drupalLogin($this->user);
    $resource_manager = restful()->getResourceManager();
    $handler = $resource_manager->getPlugin('access_token:1.0');

    // Generating token.
    $handler->doGet();

    // Blocking the user.
    user_save($this->user, array('status' => FALSE));

    // Verify the token removed.
    $query = new EntityFieldQuery();
    $result = $query
      ->entityCondition('entity_type', 'restful_token_auth')
      ->propertyCondition('uid', $this->user->uid)
      ->execute();

    $this->assertTrue(empty($result), 'The access tokens invalidated when blocking the user.');
  }

  /**
   * Test authenticating a user.
   */
  function testAuthentication() {
    // Create user.
    $this->drupalLogin($this->user);

    // Create "Article" node.
    $title1 = $this->randomName();
    $settings = array(
      'type' => 'article',
      'title' => $title1,
      'uid' => $this->user->uid,
    );
    $node1 = $this->drupalCreateNode($settings);
    $id = $node1->nid;

    $resource_manager = restful()->getResourceManager();
    $formatter = restful()->getFormatterManager()->getPlugin('single_json');
    // Get a token for the user, using the handler.
    $handler = $resource_manager->getPlugin('access_token:1.0');
    $formatter->setResource($handler);
    $result = $formatter->prepare($handler->doGet());
    $access_token = $result['access_token'];
    $refresh_token = $result['refresh_token'];
    $this->assertNotNull($access_token);
    $this->assertNotNull($refresh_token);

    // Assert the token did not change.
    $result = $formatter->prepare($handler->doGet());
    $this->assertEqual($access_token, $result['access_token'], 'Access token did not change.');

    // Get a "protected" resource without the access token.
    $handler = $resource_manager->getPlugin('articles:1.3');
    $handler->setRequest(Request::create('api/v1.3/articles'));
    $handler->setPath('');
    $formatter->setResource($handler);
    try {
      // Reset the account to trigger the auth process.
      $handler->setAccount(NULL);
      $handler->getAccount();
      $this->fail('"Unauthorized" exception not thrown.');
    }
    catch (UnauthorizedException $e) {
      $this->pass('"Unauthorized" exception was thrown.');
    }

    // Get a "protected" resource with invalid access token.
    $handler->setRequest(Request::create('api/v1.3/articles', array(
      'access_token' => 'invalid',
    )));
    try {
      // Reset the account to trigger the auth process.
      $handler->setAccount(NULL);
      $handler->getAccount();
      $this->fail('"Unauthorized" exception not thrown.');
    }
    catch (UnauthorizedException $e) {
      $this->pass('"Unauthorized" exception was thrown.');
    }

    // Get a "protected" resource with refresh token as access token.
    $handler->setRequest(Request::create('api/v1.3/articles/' . $id, array(
      'access_token' => 'invalid',
    )));
    $handler->setPath($id);
    try {
      // Reset the account to trigger the auth process.
      $handler->setAccount(NULL);
      $handler->getAccount();
      $this->fail('"Unauthorized" exception not thrown.');
    }
    catch (UnauthorizedException $e) {
      $this->pass('"Unauthorized" exception was thrown.');
    }

    // Get a "protected" resource with refresh token.
    $handler->setRequest(Request::create('api/v1.3/articles/' . $id, array(
      'refresh_token' => $refresh_token,
    )));
    $handler->setPath($id);
    try {
      // Reset the account to trigger the auth process.
      $handler->setAccount(NULL);
      $handler->getAccount();
      $this->fail('"Unauthorized" exception not thrown.');
    }
    catch (UnauthorizedException $e) {
      $this->pass('"Unauthorized" exception was thrown.');
    }

    // Get a "protected" resource with the access token.
    $response = restful()
      ->getFormatterManager()
      ->negotiateFormatter(NULL)
      ->prepare($handler->doGet($id, array('access_token' => $access_token)));
    $handler->setAccount(NULL);
    $handler->getAccount();
    // Validate the returned content.
    $result = $response['data'][0];
    $this->assertEqual($result['label'], $title1, 'Article resource can be accessed with valid access token.');

    // Set the expiration token to the past.
    $query = new \EntityFieldQuery();
    $result = $query
      ->entityCondition('entity_type', 'restful_token_auth')
      ->entityCondition('bundle', 'access_token')
      ->propertyCondition('token', $access_token)
      ->execute();

    if (empty($result['restful_token_auth'])) {
      $this->fail('No token was found.');
    }

    // Load the token.
    $access_id = key($result['restful_token_auth']);
    $token = entity_load_single('restful_token_auth', $access_id);
    $token->expire = REQUEST_TIME - 60 * 24;
    $token->save();

    // Make a GET request to trigger a deletion of the token.
    $handler = $resource_manager->getPlugin('articles:1.3');
    $formatter->setResource($handler);

    $handler->setRequest(Request::create('api/v1.3/articles/' . $id, array(
      'access_token' => $access_token,
    )));
    $handler->setPath($id);
    try {
      // Reset the account to trigger the auth process.
      $handler->setAccount(NULL);
      $handler->getAccount();
      $this->fail('"Unauthorized" exception not thrown for expired token.');
    }
    catch (UnauthorizedException $e) {
      $this->pass('"Unauthorized" exception was thrown for expired token.');
    }

    // Make sure the token was deleted.
    $query = new \EntityFieldQuery();
    $count = $query
      ->entityCondition('entity_type', 'restful_token_auth')
      ->entityCondition('bundle', 'access_token')
      ->propertyCondition('token', $access_token)
      ->count()
      ->execute();

    $this->assertFalse($count, 'The token was deleted.');

    // Test the refresh capabilities.
    $handler = $resource_manager->getPlugin('refresh_token:1.0');
    $formatter->setResource($handler);
    $result = $formatter->prepare($handler->doGet($refresh_token));
    $this->assertNotNull($result['access_token'], 'A new access token granted for a valid refresh token.');
    $this->assertNotNull($result['refresh_token'], 'A new refresh token granted for a valid refresh token.');
    $this->assertNotEqual($refresh_token, $result['refresh_token']);

    // Test invalid refresh token.
    try {
      $handler->doGet('invalid');
      $this->fail('"Bad Request" exception not thrown.');
    }
    catch (BadRequestException $e) {
      $this->pass('"Bad Request" exception was thrown.');
    }
  }

}


================================================
FILE: restful.admin.inc
================================================
<?php

use Drupal\restful\Plugin\FormatterPluginManager;

/**
 * Menu callback; Admin settings form.
 */
function restful_admin_settings($form_state) {
  $form = array();

  $form['restful_default_output_formatter'] = array(
    '#type' => 'radios',
    '#title' => t('Default formatter'),
    '#description' => t('Determine the default formatter that would be used.'),
    '#options' => array(),
    '#default_value' => variable_get('restful_default_output_formatter', 'json'),
    '#required' => TRUE,
  );

  $element = &$form['restful_default_output_formatter'];
  $formatter_manager = FormatterPluginManager::create();

  foreach ($formatter_manager->getDefinitions() as $plugin_name => $plugin) {
    $element['#options'][$plugin_name] = check_plain($plugin['label']);

    // Add description for each formatter.
    if (!$plugin['description']) {
      continue;
    }

    $element[$plugin_name]['#description'] = check_plain($plugin['description']);
  }

  $params = array(
    '@api' => variable_get('restful_hook_menu_base_path', 'api'),
  );

  $form['file_upload'] = array(
    '#type' => 'fieldset',
    '#title' => t('File upload'),
  );

  $form['file_upload']['restful_file_upload'] = array(
    '#type' => 'checkbox',
    '#title' => t('File upload'),
    '#description' => t('When enabled a file upload resource will be available.'),
    '#default_value' => variable_get('restful_file_upload', FALSE),
  );

  $form['file_upload']['restful_file_upload_allow_anonymous_user'] = array(
    '#type' => 'checkbox',
    '#title' => t('Anonymous file upload'),
    '#description' => t('When enabled a file upload resource will be available also for anonymous users.'),
    '#default_value' => variable_get('restful_file_upload_allow_anonymous_user', FALSE),
    '#states' => array(
      'visible' => array(
        ':input[name=restful_file_upload]' => array('checked' => TRUE),
      ),
    ),
  );

  $form['restful_show_access_denied'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show access denied records'),
    '#description' => t('Check this box to get an HTTP 403 error when requesting entities with access denied. Listing denied entities will remove them from the output and have a flag indicating the access violation. Leave it unchecked to hide access denied records. If you do not care about unpriviledged users knowing that records they do not have access to exist, you can check this box.'),
    '#default_value' => variable_get('restful_show_access_denied', FALSE),
  );

  $form['restful_allowed_origin'] = array(
    '#type' => 'textfield',
    '#title' => t('Allowed origin'),
    '#description' => t('When you make an XHR (AJAX) call to a resource under a different host, most modern browsers will make an initial OPTIONS request to the resource. The response to that can contain the Access-Control-Allow-Origin, if that includes the domain making the request the browser will allow the cross-domain request. The contents of this field will be used in that header. Use <em>*</em> to allow any origin.'),
    '#default_value' => variable_get('restful_allowed_origin', ''),
  );

  $form['advanced'] = array(
    '#type' => 'fieldset',
    '#title' => t('Advanced'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );

  $form['advanced']['restful_hijack_api_pages'] = array(
    '#type' => 'checkbox',
    '#title' => t('Hijack API pages'),
    '#description' => t('When enabled all URLS under @api will be handled by RESTful module.', $params),
    '#default_value' => variable_get('restful_hijack_api_pages', TRUE),
  );

  $form['advanced']['restful_hook_menu_base_path'] = array(
    '#type' => 'textfield',
    '#title' => t('API Base path'),
    '#description' => t('Determines the base path of all resources.'),
    '#default_value' => variable_get('restful_hook_menu_base_path', 'api'),
  );

  $form['advanced']['restful_enable_user_login_resource'] = array(
    '#type' => 'checkbox',
    '#title' => t('Login resource'),
    '#description' => t('Determines if the default user login resource should be enabled.'),
    '#default_value' => variable_get('restful_enable_user_login_resource', TRUE),
  );

  $form['advanced']['restful_enable_users_resource'] = array(
    '#type' => 'checkbox',
    '#title' => t('User resource'),
    '#description' => t('Determines if the default user resource should be enabled.'),
    '#default_value' => variable_get('restful_enable_users_resource', TRUE),
  );

  $form['advanced']['restful_enable_discovery_resource'] = array(
    '#type' => 'checkbox',
    '#title' => t('Discovery resource'),
    '#description' => t('Enable discovery resource which shows all accessible resources under @api URL.', $params),
    '#default_value' => variable_get('restful_enable_discovery_resource', TRUE),
  );

  $form['advanced']['restful_global_rate_limit'] = array(
    '#type' => 'textfield',
    '#title' => t('Rate limit - hits'),
    '#description' => t('The number of allowed hits. This is global for all roles. 0 means no global rate limit should be applied.'),
    '#default_value' => variable_get('restful_global_rate_limit', 0),
    '#element_validate' => array('element_validate_integer'),
  );

  $form['advanced']['restful_global_rate_period'] = array(
    '#type' => 'textfield',
    '#title' => t('Rate limit - period'),
    '#description' => t('The period string compatible with <a href="@url">\DateInterval</a>. After this period the module will restart counting hits.', array('@url' => 'http://php.net/manual/en/dateinterval.createfromdatestring.php')),
    '#default_value' => variable_get('restful_global_rate_period', 'P1D'),
    '#element_validate' => array('restful_date_time_format_element_validate'),
  );

  return system_settings_form($form);
}


================================================
FILE: restful.api.php
================================================
<?php

/**
 * @file
 * Hooks provided by the RESTful module.
 */

/**
 * @addtogroup hooks
 * @{
 */


/**
 * Allow altering the request before it is processed.
 *
 * @param \Drupal\restful\Http\RequestInterface $request
 *   The request object.
 */
function hook_restful_parse_request_alter(\Drupal\restful\Http\RequestInterface &$request) {
  // Allow implementor modules to alter the request object.
  $request->setApplicationData('csrf_token', 'token');
}

/**
 * Allow altering the request before it is processed.
 *
 * @param \Drupal\restful\Plugin\resource\ResourceInterface &$resource
 *   The resource object to alter.
 */
function hook_restful_resource_alter(\Drupal\restful\Plugin\resource\ResourceInterface &$resource) {
  // Chain a decorator with the passed in resource based on the resource
  // annotation definition.
  $plugin_definition = $resource->getPluginDefinition();
  if (!empty($plugin_definition['renderCache']) && !empty($plugin_definition['renderCache']['render'])) {
    $resource = new \Drupal\restful\Plugin\resource\CachedResource($resource);
  }
}

/**
 * @} End of "addtogroup hooks".
 */


================================================
FILE: restful.cache.inc
================================================
<?php

/**
 * @file
 * Procedural implementations for cache related features.
 */
use Drupal\restful\RenderCache\RenderCache;

/**
 * Clears all caches and associated fragments.
 */
function restful_clear_caches() {
  /* @var \Drupal\restful\RenderCache\Entity\CacheFragmentController $controller */
  $controller = entity_get_controller('cache_fragment');
  $controller->wipe();
  cache_clear_all('*', RenderCache::CACHE_BIN, TRUE);
  drupal_set_message(t('RESTful caches were successfully cleared.'));
}

/**
 * Implements hook_flush_caches().
 */
function restful_flush_caches() {
  if (!variable_get('restful_clear_on_cc_all', FALSE)) {
    return array();
  }
  // Delete all the cache fragments.
  /* @var \Drupal\restful\RenderCache\Entity\CacheFragmentController $controller */
  $controller = entity_get_controller('cache_fragment');
  $controller->wipe();
  return array(RenderCache::CACHE_BIN);
}

/**
 * Menu callback; Admin settings form.
 */
function restful_admin_cache_settings($form_state) {
  $form = array();
  $form['restful_page_cache'] = array(
    '#type' => 'checkbox',
    '#title' => t('Page cache'),
    '#description' => t('RESTful can leverage page cache, this will boost your performace for anonymous traffic. !link to start caching responses. Status: <strong>@status</strong>. <strong>CAUTION:</strong> If your resources are using authentication providers other than cookie, you will want to turn this off. Otherwise you may get cached anonymous values for your authenticated GET requests.', array(
      '!link' => l(t('Enable page cache'), 'admin/config/development/performance'),
      '@status' => variable_get('cache', FALSE) ? t('Enabled') : t('Disabled'),
    )),
    '#disabled' => !variable_get('cache', FALSE),
    '#default_value' => variable_get('restful_page_cache', FALSE) && variable_get('cache', FALSE),
  );

  $form['restful_render_cache'] = array(
    '#type' => 'checkbox',
    '#title' => t('Cache results'),
    '#description' => t('When enabled any resource that has not explicitly disabled the caching will be cached. Note that the first hit may result with slower response, although the next ones would be significantly faster. This is different from the page cache in the sense that it acts at the row level (a single entity, a single database row, ...), therefore allowing you to assemble non cached pages with the cached bits faster.'),
    '#default_value' => variable_get('restful_render_cache', FALSE),
  );

  $form['clear_restful'] = array(
    '#submit' => array('restful_clear_caches'),
    '#type' => 'submit',
    '#value' => t('Clear render caches'),
    '#disabled' => !variable_get('restful_render_cache', FALSE) && user_access('restful clear render caches'),
  );

  $form['restful_clear_on_cc_all'] = array(
    '#type' => 'checkbox',
    '#title' => t('Clear on global flush'),
    '#description' => t("Check this box to clear the render caches when clearing Drupal's caches. In general the render caches are more robust than the TTL based caches. The recommended value is unchecked."),
    '#default_value' => variable_get('restful_clear_on_cc_all', FALSE),
  );

  $form['restful_fast_cache_clear'] = array(
    '#type' => 'checkbox',
    '#title' => t('Fast cache clear'),
    '#description' => t('A lot of cache fragment entries may be created by default. This may cause your cache clears to be slow. By checking this checkbox the cache fragments are deleted from the database in a fast manner. As a trade-in, no hook_entity_delete will be fired for the cache fragment entities. This is OK in the vast majority of the cases. You can mitigate the number of generated fragments by overriding the "getCacheContext" method in your data provider.'),
    '#default_value' => variable_get('restful_fast_cache_clear', TRUE),
  );

  return system_settings_form($form);
}


================================================
FILE: restful.entity.inc
================================================
<?php

/**
 * @file
 * Contains entity related code.
 */

use Doctrine\Common\Collections\ArrayCollection;
use Drupal\restful\Exception\ServerConfigurationException;
use Drupal\restful\Plugin\resource\Decorators\CacheDecoratedResource;
use Drupal\restful\Plugin\resource\Decorators\CacheDecoratedResourceInterface;
use Drupal\restful\RenderCache\Entity\CacheFragmentController;
use Drupal\restful\RenderCache\RenderCache;

/**
 * Implements hook_entity_info().
 */
function restful_entity_info() {
  $items['rate_limit'] = array(
    'label' => t('Rate limit'),
    'entity class' => '\\Drupal\\restful\\RateLimit\\Entity\\RateLimit',
    'controller class' => '\\Drupal\\restful\\RateLimit\\Entity\\RateLimitController',
    'base table' => 'restful_rate_limit',
    'fieldable' => TRUE,
    'entity keys' => array(
      'id' => 'rlid',
      'label' => 'identifier',
      'bundle' => 'event',
    ),
    'bundles' => array(),
    'bundle keys' => array(
      'bundle' => 'type',
    ),
    'module' => 'restful',
    'entity cache' => module_exists('entitycache'),
  );
  $items['cache_fragment'] = array(
    'label' => t('Cache fragment'),
    'entity class' => '\\Drupal\\restful\\RenderCache\\Entity\\CacheFragment',
    'controller class' => '\\Drupal\\restful\\RenderCache\\Entity\\CacheFragmentController',
    'base table' => 'restful_cache_fragment',
    'fieldable' => FALSE,
    'entity keys' => array(
      'id' => 'tid',
      'label' => 'identifier',
      'bundle' => 'type',
    ),
    'bundles' => array(),
    'bundle keys' => array(
      'bundle' => 'type',
    ),
    'module' => 'restful',
    'entity cache' => FALSE,
  );

  return $items;
}

/**
 * Helper function that extract cache hashes from an entity.
 */
function _restful_entity_cache_hashes($entity, $type) {
  if ($type == 'cache_fragment') {
    return array();
  }
  // Limit to the fragments for our entity type.
  list($entity_id) = entity_extract_ids($type, $entity);
  $query = new \EntityFieldQuery();
  $query
    ->entityCondition('entity_type', 'cache_fragment')
    ->propertyCondition('type', 'entity')
    ->propertyCondition('value', CacheDecoratedResource::serializeKeyValue($type, $entity_id));
  return CacheFragmentController::lookUpHashes($query);
}

/**
 * Implements hook_entity_update().
 */
function restful_entity_update($entity, $type) {
  $hashes = &drupal_static('restful_entity_clear_hashes', array());
  $new_hashes = _restful_entity_cache_hashes($entity, $type);
  array_walk($new_hashes, '_restful_entity_clear_all_resources');
  $hashes += $new_hashes;
  restful_register_shutdown_function_once('restful_entity_clear_render_cache');
}

/**
 * Implements hook_entity_delete().
 */
function restful_entity_delete($entity, $type) {
  $hashes = &drupal_static('restful_entity_clear_hashes', array());
  $new_hashes = _restful_entity_cache_hashes($entity, $type);
  array_walk($new_hashes, '_restful_entity_clear_all_resources');
  $hashes += $new_hashes;
  restful_register_shutdown_function_once('restful_entity_clear_render_cache');
}

/**
 * Implements hook_user_update().
 */
function restful_user_update(&$edit, $account, $category) {
  // Search for all the cache fragments with our entity id.
  $query = new \EntityFieldQuery();
  $query
    ->entityCondition('entity_type', 'cache_fragment')
    ->propertyCondition('type', 'user_id')
    ->propertyCondition('value', $account->uid);
  $hashes = &drupal_static('restful_entity_clear_hashes', array());
  $new_hashes = CacheFragmentController::lookUpHashes($query);
  array_walk($new_hashes, '_restful_entity_clear_all_resources');
  $hashes += $new_hashes;
  restful_register_shutdown_function_once('restful_entity_clear_render_cache');
}

/**
 * Implements hook_user_delete().
 */
function restful_user_delete($account) {
  // Search for all the cache fragments with our entity id.
  $query = new \EntityFieldQuery();
  $query
    ->entityCondition('entity_type', 'cache_fragment')
    ->propertyCondition('type', 'user_id')
    ->propertyCondition('value', $account->uid);
  $hashes = &drupal_static('restful_entity_clear_hashes', array());
  $new_hashes = CacheFragmentController::lookUpHashes($query);
  array_walk($new_hashes, '_restful_entity_clear_all_resources');
  $hashes += $new_hashes;
  restful_register_shutdown_function_once('restful_entity_clear_render_cache');
}

/**
 * Helper function to schedule a shutdown once.
 *
 * @param callable $callback
 *   The callback.
 */
function restful_register_shutdown_function_once($callback) {
  $existing_callbacks = drupal_register_shutdown_function();
  $added = (bool) array_filter($existing_callbacks, function ($item) use ($callback) {
    return $item['callback'] == $callback;
  });
  if (!$added) {
    drupal_register_shutdown_function($callback);
  }
}

/**
 * Clear the cache back ends for the given hash.
 *
 * @param string $cid
 *   The cache ID to clear.
 */
function _restful_entity_clear_all_resources($cid) {
  if (!$instance_id = CacheFragmentController::resourceIdFromHash($cid)) {
    return;
  }
  try {
    $handler = restful()->getResourceManager()->getPlugin($instance_id);
  }
  catch (ServerConfigurationException $e) {
    watchdog_exception('restful', $e);
    return;
  }
  if (!$handler instanceof CacheDecoratedResourceInterface) {
    return;
  }
  // Clear the cache bin.
  $handler->getCacheController()->clear($cid);
}

/**
 * Delete the scheduled fragments and caches on shutdown.
 */
function restful_entity_clear_render_cache() {
  if ($hashes = drupal_static('restful_entity_clear_hashes', array())) {
    $hashes = array_unique($hashes);
    drupal_static_reset('restful_entity_clear_hashes');
    $resource_manager = restful()->getResourceManager();
    foreach ($hashes as $hash) {
      if (!$instance_id = CacheFragmentController::resourceIdFromHash($hash)) {
        continue;
      }
      $handler = $resource_manager->getPlugin($instance_id);
      if (!$handler instanceof CacheDecoratedResourceInterface) {
        continue;
      }
      if (!$handler->hasSimpleInvalidation()) {
        continue;
      }
      // You can get away without the fragments for a clear.
      $cache_object = new RenderCache(new ArrayCollection(), $hash, $handler->getCacheController());
      // Do a clear with the RenderCache object to also remove the cache
      // fragment entities.
      $cache_object->clear();
    }
  }
}


================================================
FILE: restful.info
================================================
name = RESTful
description = Turn Drupal to a RESTful server, following best practices.
core = 7.x
php = 5.5.9
dependencies[] = entity
dependencies[] = plug
configure = admin/config/services/restful

registry_autoload[] = PSR-0
registry_autoload[] = PSR-4

; Temporary workaround to allow RESTful to work fine on PHP7.
registry_autoload_files[] = src/Util/ExplorableDecoratorInterface.php

; Tests
files[] = tests/RestfulAuthenticationTestCase.test
files[] = tests/RestfulCommentTestCase.test
files[] = tests/RestfulCreateEntityTestCase.test
files[] = tests/RestfulCreateNodeTestCase.test
files[] = tests/RestfulCreatePrivateNodeTestCase.test
files[] = tests/RestfulCreateTaxonomyTermTestCase.test
files[] = tests/RestfulCsrfTokenTestCase.test
files[] = tests/RestfulCurlBaseTestCase.test
files[] = tests/RestfulDataProviderPlugPluginsTestCase.test
files[] = tests/RestfulDbQueryTestCase.test
files[] = tests/RestfulVariableTestCase.test
files[] = tests/RestfulDiscoveryTestCase.test
files[] = tests/RestfulEntityAndPropertyAccessTestCase.test
files[] = tests/RestfulEntityUserAccessTestCase.test
files[] = tests/RestfulEntityValidatorTestCase.test
files[] = tests/RestfulExceptionHandleTestCase.test
files[] = tests/RestfulForbiddenItemsTestCase.test
files[] = tests/RestfulGetHandlersTestCase.test
files[] = tests/RestfulHalJsonTestCase.test
files[] = tests/RestfulHookMenuTestCase.test
files[] = tests/RestfulJsonApiTestCase.test
files[] = tests/RestfulListEntityMultipleBundlesTestCase.test
files[] = tests/RestfulListTestCase.test
files[] = tests/RestfulRateLimitTestCase.test
files[] = tests/RestfulReferenceTestCase.test
files[] = tests/RestfulRenderCacheTestCase.test
files[] = tests/RestfulSimpleJsonTestCase.test
files[] = tests/RestfulUpdateEntityTestCase.test
files[] = tests/RestfulSubResourcesCreateEntityTestCase.test
files[] = tests/RestfulUpdateEntityCurlTestCase.test
files[] = tests/RestfulUserLoginCookieTestCase.test
files[] = tests/RestfulViewEntityMultiLingualTestCase.test
files[] = tests/RestfulViewEntityTestCase.test
files[] = tests/RestfulViewModeAndFormatterTestCase.test


================================================
FILE: restful.install
================================================
<?php

/**
 * @file
 * Install, update, and uninstall functions for the RESTful module.
 */

/**
 * Implements hook_schema().
 */
function restful_schema() {
  $schema = array();

  $schema['cache_restful'] = drupal_get_schema_unprocessed('system', 'cache');

  // Rate limit entity base table.
  $schema['restful_rate_limit'] = array(
    'description' => 'Rate limit base table',
    'fields' => array(
      'rlid' => array(
        'description' => 'The rate limit unique ID.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'event' => array(
        'description' => 'The event name.',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'identifier' => array(
        'description' => 'The user & request identifier.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
      'timestamp' => array(
        'description' => 'The Unix timestamp when the rate limit window started.',
        'type' => 'int',
        'not null' => FALSE,
        'default' => NULL,
      ),
      'expiration' => array(
        'description' => 'The Unix timestamp when the rate limit window expires.',
        'type' => 'int',
        'not null' => FALSE,
        'default' => NULL,
      ),
      'hits' => array(
        'description' => 'The number of hits.',
        'type' => 'int',
        'not null' => FALSE,
        'default' => 0,
      ),
    ),
    'unique keys' => array(
      'identifier' => array('identifier'),
    ),
    'indexes' => array(
      'rate_limit_identifier' => array('identifier'),
    ),
    'primary key' => array('rlid'),
  );

  // Cache fragment entity base table.
  $schema['restful_cache_fragment'] = array(
    'description' => 'Cache fragment base table',
    'fields' => array(
      'tid' => array(
        'description' => 'The cache fragment unique ID.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'type' => array(
        'description' => 'The type of the cache fragment, e.g "entity_id".',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'value' => array(
        'description' => 'The value for the tag. Example: 182.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'hash' => array(
        'description' => 'The hash used as a cache ID.',
        'type' => 'char',
        'length' => 40,
        'not null' => FALSE,
        'default' => NULL,
      ),
    ),
    'indexes' => array(
      'cache_fragment_hash' => array('hash'),
    ),
    'unique keys' => array(
      'hash_key_val' => array('type', 'value', 'hash'),
    ),
    'primary key' => array('tid'),
  );
  return $schema;
}

/**
 * Implements hook_uninstall().
 */
function restful_uninstall() {
  variable_del('restful_default_output_formatter');

  variable_del('restful_enable_discovery_resource');

  variable_del('restful_file_upload');
  variable_del('restful_file_upload_allow_anonymous_user');

  variable_del('restful_hijack_api_pages');
  variable_del('restful_hook_menu_base_path');

  variable_del('restful_enable_user_login_resource');

  variable_del('restful_global_rate_limit');
  variable_del('restful_global_rate_period');

  variable_del('restful_enable_users_resource');

  variable_del('restful_render_cache');
  variable_del('restful_skip_basic_auth');

  variable_del('restful_allowed_origin');
}

/**
 * Create the cache fragments schema.
 */
function restful_update_7200() {
  $table_schema = drupal_get_schema('restful_cache_fragment', TRUE);
  db_create_table('restful_cache_fragment', $table_schema);
}

/**
 * Clear RESTful cache on cache flush.
 */
function restful_update_7201() {
  // Even if the recommended value is FALSE, there might be some deploy
  // workflows that assume cache clearing.
  variable_set('restful_clear_on_cc_all', TRUE);
}


================================================
FILE: restful.module
================================================
<?php

/**
 * @file
 * Turn Drupal to a RESTful server, following best practices.
 */

include_once __DIR__ . '/restful.entity.inc';
include_once __DIR__ . '/restful.cache.inc';

use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\Component\Plugin\PluginBase;
use Drupal\restful\Exception\RestfulException;
use Drupal\restful\Http\HttpHeader;
use Drupal\restful\Http\RequestInterface;
use Drupal\restful\Http\Response;
use Drupal\restful\Http\ResponseInterface;
use Drupal\restful\Plugin\resource\Decorators\CacheDecoratedResource;
use Drupal\restful\Plugin\resource\Decorators\RateLimitDecoratedResource;
use Drupal\restful\Plugin\resource\ResourceInterface;
use Drupal\restful\RestfulManager;

/**
 * Implements hook_menu().
 */
function restful_menu() {
  $base_path = variable_get('restful_hook_menu_base_path', 'api');
  $items = array();
  $plugins = restful()
    ->getResourceManager()
    ->getPlugins();
  foreach ($plugins->getIterator() as $plugin) {
    if (!$plugin instanceof ResourceInterface) {
      // If the plugin is disabled $plugin gets set to NULL. If that is the case
      // do not set any menu values based on it.
      continue;
    }
    $plugin_definition = $plugin->getPluginDefinition();
    if (!$plugin_definition['hookMenu']) {
      // Plugin explicitly declared no hook menu should be created automatically
      // for it.
      continue;
    }
    $item = array(
      'title' => $plugin_definition['name'],
      'access callback' => RestfulManager::FRONT_CONTROLLER_ACCESS_CALLBACK,
      'access arguments' => array($plugin_definition['resource']),
      'page callback' => RestfulManager::FRONT_CONTROLLER_CALLBACK,
      'page arguments' => array($plugin_definition['resource']),
      'delivery callback' => 'restful_delivery',
      'type' => MENU_CALLBACK,
    );
    // If there is no specific menu item allow the different version variations.
    if (!isset($plugin_definition['menuItem'])) {
      // Add the version string to the arguments.
      $item['access arguments'][] = 1;
      $item['page arguments'][] = 1;
      // Ex: api/v1.2/articles
      $items[$base_path . '/v' . $plugin_definition['majorVersion'] . '.' . $plugin_definition['minorVersion'] . '/' . $plugin_definition['resource']] = $item;
      // Ex: api/v1/articles will use the latest minor version.
      $items[$base_path . '/v' . $plugin_definition['majorVersion'] . '/' . $plugin_definition['resource']] = $item;
      // Ex: api/articles will use the header or the latest version.
      // Do not add the version string to the arguments.
      $item['access arguments'] = $item['page arguments'] = array(1);
      $items[$base_path . '/' . $plugin_definition['resource']] = $item;
    }
    else {
      $path = implode('/', array($base_path, $plugin_definition['menuItem']));

      // Remove trailing slashes that can lead to 404 errors.
      $path = rtrim($path, '/');

      $items[$path] = $item;
    }
  }

  // Make sure the Login endpoint has the correct access callback.
  if (!empty($items[$base_path . '/login'])) {
    $items[$base_path . '/login']['access callback'] = 'user_is_anonymous';
  }

  // Add administration page.
  $items['admin/config/services/restful'] = array(
    'title' => 'RESTful',
    'description' => 'Administer the RESTful module.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('restful_admin_settings'),
    'access arguments' => array('administer restful'),
    'file' => 'restful.admin.inc',
  );
  $items['admin/config/services/restful/restful'] = $items['admin/config/services/restful'];
  $items['admin/config/services/restful/restful']['type'] = MENU_DEFAULT_LOCAL_TASK;
  // Add cache administration page.
  $items['admin/config/services/restful/cache'] = array(
    'title' => 'Cache',
    'description' => 'Administer the RESTful module cache system.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('restful_admin_cache_settings'),
    'access arguments' => array('administer restful'),
    'file' => 'restful.cache.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
  );

  return $items;
}

/**
 * Implements hook_permission().
 */
function restful_permission() {
  return array(
    'administer restful' => array(
      'title' => t('Administer the RESTful module'),
      'description' => t('Access the administration pages for the RESTful module.'),
    ),
    'administer restful resources' => array(
      'title' => t('Administer the resources'),
      'description' => t('Perform operations on the resources.'),
    ),
    'restful clear render caches' => array(
      'title' => t('Clear RESTful render caches'),
      'description' => t('Clear the render caches and their correspoding cache fragments.'),
    ),
  );
}

/**
 * Implements hook_help().
 */
function restful_help($path, $arg) {
  switch ($path) {
    case 'admin/config/services/restful':
    case 'admin/help#restful':
      $message = t('This module is managed in GitHub. Please make sure to read the files in the !link folder for more help.', array(
        '!link' => l(t('Docs'), 'https://github.com/RESTful-Drupal/restful/tree/7.x-2.x/docs'),
      ));
      return '<p>' . $message . '</p>';

    case 'admin/config/services/restful/cache':
      $message = t('The RESTful module contains several layers of caching for enhanced performance: (1) page cache (aka URL level caching) for anonymous users. This cache is extremely fast, but not very flexible. (2) The render cache can be configured for each resource and allows you to serve cached versions of your records (even to authenticated users!). The render cache also contains smart invalidation, which means that you do not need to have a TTL based cache system. Instead the caches are evicted when automatically when necessary.');
      return '<p>' . $message . '</p>';

  }
}

/**
 * Get the RestfulManager.
 *
 * Calling restful() from anywhere in the code will give you access to the
 * RestfulManager. That in turn will provide you access to all the elements
 * involved.
 *
 * @return RestfulManager
 *   The manager.
 */
function restful() {
  static $manager;
  if (!isset($manager)) {
    $manager = RestfulManager::createFromGlobals();
  }
  return $manager;
}

/**
 * Access callback; Determine access for an API call.
 *
 * @param string $resource_name
 *   The name of the resource (e.g. "articles").
 *
 * @param string $version_string
 *   The version array.
 *
 * @return bool
 *   TRUE if user is allowed to access resource.
 */
function restful_menu_access_callback($resource_name, $version_string = NULL) {
  $resource_manager = restful()->getResourceManager();
  if (!empty($version_string) && preg_match('/v[0-9]+(\.[0-9]+)?/', $version_string)) {
    $version_string = substr($version_string, 1);
    $parsed_versions = explode('.', $version_string);
    if (count($parsed_versions) == 2) {
      // If there is only the major we need to get the version from the request,
      // to get the latest version within the major version.
      $versions = $parsed_versions;
    }
  }
  if (empty($versions) && !$versions = $resource_manager->getVersionFromRequest()) {
    // No version could be found.
    return FALSE;
  }

  try {
    $instance_id = $resource_name . PluginBase::DERIVATIVE_SEPARATOR . implode('.', $versions);
    $resource = $resource_manager->getPlugin($instance_id, restful()->getRequest());
    if (!$resource) {
      // Throw a PluginNotFoundException exception instead of a denied access.
      throw new PluginNotFoundException($instance_id);
    }
    return $resource->access();
  }
  catch (RestfulException $e) {
    // We can get here if the request method is not valid or if no resource can
    // be negotiated.
    $response = restful()->getResponse();
    $output = _restful_build_http_api_error($e, $response);
    $response->setStatusCode($e->getCode());
    $response->setContent(drupal_json_encode($output));
    $response->send();
    exit();
  }
  catch (PluginNotFoundException $e) {
    restful_delivery(MENU_NOT_FOUND);
    exit();
  }
}

/**
 * Page callback; Return the response for an API call.
 *
 * @param string $resource_name
 *   The name of the resource (e.g. "articles").
 * @param string $version
 *   The version, prefixed with v (e.g. v1, v2.2).
 *
 * @throws \Drupal\restful\Exception\ServiceUnavailableException
 *
 * @return string
 *   JSON output with the result of the API call.
 *
 * @see http://tools.ietf.org/html/draft-nottingham-http-problem-06
 */
function restful_menu_process_callback($resource_name, $version = NULL) {
  $path = func_get_args();
  array_shift($path);
  if (preg_match('/^v\d+(\.\d+)?$/', $version)) {
    array_shift($path);
  }
  $resource_manager = restful()->getResourceManager();
  list($major_version, $minor_version) = $resource_manager->getVersionFromRequest();
  $request = restful()->getRequest();
  $request->setViaRouter(TRUE);
  $resource = $resource_manager->getPlugin($resource_name . PluginBase::DERIVATIVE_SEPARATOR . $major_version . '.' . $minor_version, $request);

  $response_headers = restful()
    ->getResponse()
    ->getHeaders();

  $version_array = $resource->getVersion();
  $version_string = 'v' . $version_array['major'] . '.' . $version_array['minor'];
  $response_headers->add(HttpHeader::create('X-API-Version', $version_string));

  // Vary the response with the presence of the X-API-Version or Accept headers.
  $vary = $request
    ->getHeaders()
    ->get('Vary')
    ->getValueString() ?: '';
  $additional_variations = array($vary, 'Accept');
  if ($x_api_version = $request
    ->getHeaders()
    ->get('X-API-Version')
    ->getValueString()) {
    $additional_variations[] = 'X-API-Version';
  }
  if ($additional_variations) {
    $response_headers->append(HttpHeader::create('Vary', implode(',', $additional_variations)));
  }

  // Always add the allow origin if configured.
  $plugin_definition = $resource->getPluginDefinition();
  if (!empty($plugin_definition['allowOrigin'])) {
    $response_headers->append(HttpHeader::create('Access-Control-Allow-Origin', $plugin_definition['allowOrigin']));
  }

  try {
    $resource->setPath(implode('/', $path));
    $result = $resource->process();
  }
  catch (RestfulException $e) {
    $result = _restful_build_http_api_error($e);
  }
  catch (Exception $e) {
    $result = array(
      'type' => 'http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1',
      'title' => $e->getMessage(),
      'status' => 500,
    );
  }

  // If the user was switched during the execution thread, then switch it back.
  $resource->switchUserBack();
  return $result;
}

/**
 * Returns data in JSON format.
 *
 * We do not use drupal_json_output(), in order to maintain the "Content-Type"
 * header.
 *
 * @param mixed $var
 *   (optional) If set, the variable will be converted to JSON and output.
 *
 * @see restful_menu_process_callback()
 */
function restful_delivery($var = NULL) {
  if (!isset($var)) {
    return;
  }
  $response = _restful_delivery_fill_reponse($var, restful()->getResponse());
  $response->send();
}

/**
 * Gets the response object to be send.
 *
 * @param mixed $var
 *   If set, the variable will be converted to JSON and output.
 * @param ResponseInterface $response
 *   If set, this response will be used to add the response data.
 *
 * @return ResponseInterface
 *   A prepared response for sending.
 */
function _restful_delivery_fill_reponse($var, ResponseInterface $response = NULL) {
  $request = restful()->getRequest();
  $response = $response ? $response : new Response();
  if (!empty($var['status'])) {
    $response->setStatusCode($var['status']);
  }
  if (is_int($var)) {
    _restful_get_data_from_menu_status($var);
    if (!empty($var['status'])) {
      $response->setStatusCode($var['status']);
    }

    try {
      // Adhere to the API Problem draft proposal.
      $formatter_id = variable_get('restful_default_output_formatter', 'json');
      // Get the data in the default output format.
      $data = restful()
        ->getFormatterManager()
        ->negotiateFormatter(NULL, $formatter_id)
        ->format($var);

      $response->setContent($data);
      $response->prepare($request);
      return $response;
    }
    catch (RestfulException $e) {
      // If there is an exception during delivery, just JSON encode this.
      $output = _restful_build_http_api_error($e, $response);
      $response->setStatusCode($e->getCode());
      $response->setContent(drupal_json_encode($output));
      return $response;
    }
  }

  try {
    // Get the formatter for the current resource.
    $resource = restful()
      ->getResourceManager()
      ->negotiate();
    // Get a new formatter manager.
    $formatter_manager = restful()
      ->getFormatterManager();
    $formatter_manager->setResource($resource);
    $plugin_definition = $resource->getPluginDefinition();
    if ($request->getMethod() == RequestInterface::METHOD_OPTIONS) {
      // There is no guarantee that other formatters can process the
      // auto-discovery output correctly.
      $formatter_name = 'json';
    }
    else {
      $formatter_name = isset($plugin_definition['formatter']) ? $plugin_definition['formatter'] : NULL;
    }
    $output = $formatter_manager->format($var, $formatter_name);
    $response->setContent($output);
  }
  catch (RestfulException $e) {
    // Handle if the formatter does not exist.
    $output = _restful_build_http_api_error($e, $response);
    $response->setStatusCode($e->getCode());
    $response->setContent(drupal_json_encode($output));
    return $response;
  }

  $response->prepare($request);
  return $response;
}

/**
 * Convert a menu status response to a valid JSON.
 *
 * @param int $var
 *   The integer value of the menu status, passed by reference.
 */
function _restful_get_data_from_menu_status(&$var) {
  switch ($var) {
    case MENU_NOT_FOUND:
      $class_name = '\Drupal\restful\Exception\NotFoundException';
      $message = 'Invalid URL path.';
      break;

    case MENU_ACCESS_DENIED:
      $class_name = '\Drupal\restful\Exception\ForbiddenException';
      $message = 'Access denied.';
      break;

    case MENU_SITE_OFFLINE:
      $class_name = '\Drupal\restful\Exception\ServiceUnavailableException';
      $message = 'Site is offline.';
      break;

    default:
      $class_name = '\Drupal\restful\Exception\RestfulException';
      $message = 'Unknown exception';
  }

  $var = _restful_build_http_api_error(new $class_name($message));
}

/**
 * Helper function to build the structured array for the error output.
 *
 * @param RestfulException $exception
 *   The exception.
 * @param ResponseInterface $response
 *   The response object to alter.
 *
 * @return array
 *   The structured output.
 */
function _restful_build_http_api_error(RestfulException $exception, ResponseInterface $response = NULL) {
  $response = $response ?: restful()->getResponse();
  // Adhere to the API Problem draft proposal.
  $exception->setHeader('Content-Type', 'application/problem+json; charset=utf-8');
  $result = array(
    'type' => $exception->getType(),
    'title' => $exception->getMessage(),
    'status' => $exception->getCode(),
    'detail' => $exception->getDescription(),
  );

  if ($instance = $exception->getInstance()) {
    $result['instance'] = $instance;
  }

  if ($errors = $exception->getFieldErrors()) {
    $result['errors'] = $errors;
  }

  $headers = $response->getHeaders();
  foreach ($exception->getHeaders() as $header_name => $header_value) {
    $headers->add(HttpHeader::create($header_name, $header_value));
  }
  drupal_page_is_cacheable(FALSE);

  // Add a log entry with the error / warning.
  if ($exception->getCode() < 500) {
    // Even though it's an exception, it's in fact not a server error - it
    // might be just access denied, or a bad request, so we just want to log
    // it, but without marking it as an actual exception.
    watchdog('restful', $exception->getMessage());
  }
  else {
    watchdog_exception('restful', $exception);
  }
  return $result;
}

/**
 * Implements hook_page_delivery_callback_alter().
 *
 * Hijack api/* to be under RESTful. We make sure that any call to api/* pages
 * that isn't valid, will still return with a well formatted error, instead of
 * a 404 HTML page.
 */
function restful_page_delivery_callback_alter(&$callback) {
  if (!variable_get('restful_hijack_api_pages', TRUE)) {
    return;
  }

  $base_path = variable_get('restful_hook_menu_base_path', 'api');

  if (strpos($_GET['q'], $base_path . '/') !== 0 && $_GET['q'] != $base_path) {
    // Page doesn't start with the base path (e.g. "api" or "api/").
    return;
  }

  if (menu_get_item()) {
    // Path is valid (i.e. not 404).
    return;
  }

  $callback = 'restful_deliver_menu_not_found';
}

/**
 * Delivers a not found (404) error.
 */
function restful_deliver_menu_not_found($page_callback_result) {
  restful_delivery(MENU_NOT_FOUND);
}

/**
 * Implements hook_cron().
 */
function restful_cron() {
  \Drupal\restful\RateLimit\RateLimitManager::deleteExpired();
}

/**
 * Page callback: returns a session token for the currently active user.
 */
function restful_csrf_session_token() {
  return array('X-CSRF-Token' => drupal_get_token(\Drupal\restful\Plugin\authentication\Authentication::TOKEN_VALUE));
}

/**
 * Element validate \DateTime format function.
 */
function restful_date_time_format_element_validate($element, &$form_state) {
  $value = $element['#value'];
  try {
    new \DateInterval($value);
  }
  catch (\Exception $e) {
    form_error($element, t('%name must be compatible with the !link.', array(
      '%name' => $element['#title'],
      '!link' => l(t('\DateInterval format'), 'http://php.net/manual/en/class.dateinterval.php'),
    )));
  }
}

/**
 * Implements hook_restful_resource_alter().
 *
 * Decorate an existing resource with other services (e.g. rate limit and render
 * cache).
 */
function restful_restful_resource_alter(ResourceInterface &$resource) {
  // Disable any plugin in the disabled plugins variable.
  $disabled_plugins = array(
    // Disable the Files Upload resource based on the settings variable.
    'files_upload:1.0' => (bool) !variable_get('restful_file_upload', FALSE),
    // Disable the Users resources based on the settings variable.
    'users:1.0' => (bool) !variable_get('restful_enable_users_resource', TRUE),
    // Disable the Login Cookie resources based on the settings variable.
    'login_cookie:1.0' => (bool) !variable_get('restful_enable_user_login_resource', TRUE),
    // Disable the Discovery resource based on the settings variable.
    'discovery:1.0' => (bool) !variable_get('restful_enable_discovery_resource', TRUE),
  ) + variable_get('restful_disabled_plugins', array());
  if (!empty($disabled_plugins[$resource->getResourceName()])) {
    $resource->disable();
  }
  elseif (
    isset($disabled_plugins[$resource->getResourceName()]) &&
    $disabled_plugins[$resource->getResourceName()] === FALSE &&
    !$resource->isEnabled()
  ) {
    $resource->enable();
  }

  $plugin_definition = $resource->getPluginDefinition();

  // If render cache is enabled for the current resource, or there is no render
  // cache information for the resource but render cache is enabled globally,
  // then decorate the resource with cache capabilities.
  if (
    !empty($plugin_definition['renderCache']['render']) ||
    (!isset($plugin_definition['renderCache']['render']) && variable_get('restful_render_cache', FALSE))
  ) {
    $resource = new CacheDecoratedResource($resource);
  }
  // Check for the rate limit configuration.
  if (!empty($plugin_definition['rateLimit']) || variable_get('restful_global_rate_limit', 0)) {
    $resource = new RateLimitDecoratedResource($resource);
  }

  // Disable the discovery endpoint if it's disabled.
  if (
    $resource->getResourceMachineName() == 'discovery' &&
    !variable_get('restful_enable_discovery_resource', TRUE) &&
    $resource->isEnabled()
  ) {
    $resource->disable();
  }
}


================================================
FILE: src/Annotation/Authentication.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Annotation\RateLimit.
 */

namespace Drupal\restful\Annotation;

use Drupal\Component\Annotation\Plugin;

/**
 * Defines a RateLimit annotation object.
 *
 * @ingroup plug_example_api
 *
 * @Annotation
 */
class Authentication extends Plugin {

  /**
   * The human readable name.
   *
   * @var string
   */
  public $label;

  /**
   * The description.
   *
   * @var string
   */
  public $description;

  /**
   * Extra options
   *
   * @var array
   */
  public $options;
}


================================================
FILE: src/Annotation/Formatter.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Annotation\Formatter.
 */

namespace Drupal\restful\Annotation;

use Drupal\Component\Annotation\Plugin;

/**
 * Defines a Formatter annotation object.
 *
 * @ingroup plug_example_api
 *
 * @Annotation
 */
class Formatter extends Plugin {

  /**
   * The human readable name.
   *
   * @var string
   */
  public $label;

  /**
   * The description.
   *
   * @var string
   */
  public $description;

  /**
   * Information about the curie
   *
   * @var array
   */
  public $curie;

}


================================================
FILE: src/Annotation/RateLimit.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Annotation\RateLimit.
 */

namespace Drupal\restful\Annotation;

use Drupal\Component\Annotation\Plugin;

/**
 * Defines a RateLimit annotation object.
 *
 * @ingroup plug_example_api
 *
 * @Annotation
 */
class RateLimit extends Plugin {

  /**
   * The human readable name.
   *
   * @var string
   */
  public $label;

  /**
   * The description.
   *
   * @var string
   */
  public $description;

}


================================================
FILE: src/Annotation/Resource.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Annotation\Resource.
 */

namespace Drupal\restful\Annotation;

use Drupal\Component\Annotation\Plugin;

/**
 * Defines a Resource annotation object.
 *
 * @ingroup resource_api
 *
 * @Annotation
 */
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'];
  }

}


================================================
FILE: src/Authentication/AuthenticationManager.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Authentication\AuthenticationManager
 */

namespace Drupal\restful\Authentication;

use Drupal\restful\Exception\UnauthorizedException;
use Drupal\restful\Http\RequestInterface;
use Drupal\restful\Plugin\AuthenticationPluginManager;
use Drupal\restful\RestfulManager;

/**
 * Class AuthenticationManager.
 *
 * @package Drupal\restful\Authentication
 */
class AuthenticationManager implements AuthenticationManagerInterface {

  /**
   * The resolved user object.
   *
   * @var object
   */
  protected $account;

  /**
   * The authentication plugins.
   *
   * @var AuthenticationPluginCollection
   */
  protected $plugins;

  /**
   * Determines if authentication is optional.
   *
   * If FALSE, then UnauthorizedException is thrown if no authentication
   * was found. Defaults to FALSE.
   *
   * @var bool
   */
  protected $isOptional = FALSE;

  /**
   * User session state to switch user for the Drupal thread.
   *
   * @var UserSessionStateInterface
   */
  protected $userSessionState;

  /**
   * Constructs a new AuthenticationManager object.
   *
   * @param AuthenticationPluginManager $manager
   *   The authentication plugin manager.
   */
  public function __construct(AuthenticationPluginManager $manager = NULL, UserSessionStateInterface $user_session_state = NULL) {
    $this->plugins = new AuthenticationPluginCollection($manager ?: AuthenticationPluginManager::create());
    $this->userSessionState = $user_session_state ?: new UserSessionState();
  }

  /**
   * {@inheritdoc}
   */
  public function setIsOptional($is_optional) {
    $this->isOptional = $is_optional;
  }

  /**
   * {@inheritdoc}
   */
  public function getIsOptional() {
    return $this->isOptional;
  }

  /**
   * {@inheritdoc}
   */
  public function addAuthenticationProvider($plugin_id) {
    $manager = AuthenticationPluginManager::create();
    $instance = $manager->createInstance($plugin_id);
    // The get method will instantiate a plugin if not there.
    $this->plugins->setInstanceConfiguration($plugin_id, $manager->getDefinition($plugin_id));
    $this->plugins->set($plugin_id, $instance);
  }

  /**
   * {@inheritdoc}
   */
  public function addAllAuthenticationProviders() {
    $manager = AuthenticationPluginManager::create();
    foreach ($manager->getDefinitions() as $id => $plugin) {
      $this->addAuthenticationProvider($id);
    }
  }

  /**
   * {@inheritdoc}
   */
  public function getAccount(RequestInterface $request, $cache = TRUE) {
    global $user;
    // Return the previously resolved user, if any.
    if (!empty($this->account)) {
      return $this->account;
    }
    // Resolve the user based on the providers in the manager.
    $account = NULL;
    foreach ($this->plugins as $provider) {
      /* @var \Drupal\restful\Plugin\authentication\AuthenticationInterface $provider */
      if ($provider->applies($request) && ($account = $provider->authenticate($request)) && $account->uid && $account->status) {
        // The account has been loaded, we can stop looking.
        break;
      }
    }

    if (empty($account->uid) || !$account->status) {

      if (RestfulManager::isRestfulPath($request) && $this->plugins->count() && !$this->getIsOptional()) {
        // Allow caching pages for anonymous users.
        drupal_page_is_cacheable(variable_get('restful_page_cache', FALSE));

        // User didn't authenticate against any provider, so we throw an error.
        throw new UnauthorizedException('Bad credentials. Anonymous user resolved for a resource that requires authentication.');
      }

      // If the account could not be authenticated default to the global user.
      // Most of the cases the cookie provider will do this for us.
      $account = drupal_anonymous_user();

      if (!$request->isViaRouter()) {
        // If we are using the API from within Drupal and we have not tried to
        // authenticate using the 'cookie' provider, then we expect to be logged
        // in using the cookie authentication as a last resort.
        $account = $user->uid ? user_load($user->uid) : $account;
      }
    }
    if ($cache) {
      $this->setAccount($account);
    }
    // Disable page caching for security reasons so that an authenticated user
    // response never gets into the page cache for anonymous users.
    // This is necessary because the page cache system only looks at session
    // cookies, but not at HTTP Basic Auth headers.
    drupal_page_is_cacheable(!$account->uid && variable_get('restful_page_cache', FALSE));

    // Record the access time of this request.
    $this->setAccessTime($account);

    return $account;
  }

  /**
   * {@inheritdoc}
   */
  public function setAccount($account) {
    $this->account = $account;
    if (!empty($account->uid)) {
      $this->userSessionState->switchUser($account);
    }
  }

  /**
   * {@inheritdoc}
   */
  public function switchUserBack() {
    return $this->userSessionState->switchUserBack();
  }

  /**
   * {@inheritdoc}
   */
  public function getPlugins() {
    return $this->plugins;
  }

  /**
   * {@inheritdoc}
   */
  public function getPlugin($instance_id) {
    return $this->plugins->get($instance_id);
  }

  /**
   * Set the user's last access time.
   *
   * @param object $account
   *   A user account.
   *
   * @see _drupal_session_write()
   */
  protected function setAccessTime($account) {
    // This logic is pulled directly from _drupal_session_write().
    if ($account->uid && REQUEST_TIME - $account->access > variable_get('session_write_interval', 180)) {
      db_update('users')->fields(array(
        'access' => REQUEST_TIME,
      ))->condition('uid', $account->uid)->execute();
    }
  }

}


================================================
FILE: src/Authentication/AuthenticationManagerInterface.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Authentication\AuthenticationManagerInterface
 */

namespace Drupal\restful\Authentication;

use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use \Drupal\restful\Exception\UnauthorizedException;
use \Drupal\restful\Plugin\Authentication\AuthenticationInterface;
use \Drupal\restful\Plugin\AuthenticationPluginManager;
use \Drupal\restful\Http\RequestInterface;

interface AuthenticationManagerInterface {

  /**
   * Set the authentications' "optional" flag.
   *
   * @param boolean $is_optional
   *   Determines if the authentication is optional.
   */
  public function setIsOptional($is_optional);

  /**
   * Get the authentications' "optional" flag.
   *
   * @return boolean
   *   TRUE if the authentication is optional.
   */
  public function getIsOptional();

  /**
   * Adds the auth provider to the list.
   *
   * @param string $plugin_id
   *   The authentication plugin id.
   */
  public function addAuthenticationProvider($plugin_id);

  /**
   * Adds all the auth providers to the list.
   */
  public function addAllAuthenticationProviders();

  /**
   * Get the user account for the request.
   *
   * @param RequestInterface $request
   *   The request.
   * @param bool $cache
   *   Boolean indicating if the resolved user should be cached for next calls.
   *
   * @throws UnauthorizedException
   *   When bad credentials are provided.
   *
   * @return object
   *   The user object.
   */
  public function getAccount(RequestInterface $request, $cache = TRUE);

  /**
   * Setter method for the account property.
   *
   * @param object $account
   *   The account to set.
   */
  public function setAccount($account);

  /**
   * Switches the user back from the original user for the session.
   */
  public function switchUserBack();

  /**
   * Gets the plugin collection for this plugin manager.
   *
   * @return AuthenticationPluginManager
   *   The plugin manager.
   */
  public function getPlugins();

  /**
   * Get an authentication plugin instance by instance ID.
   *
   * @param string $instance_id
   *   The instance ID.
   *
   * @return AuthenticationInterface
   *   The plugin.
   *
   * @throws PluginNotFoundException
   *   If the plugin instance cannot be found.
   */
  public function getPlugin($instance_id);

}


================================================
FILE: src/Authentication/AuthenticationPluginCollection.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Authentication\AuthenticationPluginCollection
 */

namespace Drupal\restful\Authentication;

use Drupal\Core\Plugin\DefaultLazyPluginCollection;

class AuthenticationPluginCollection extends DefaultLazyPluginCollection {}


================================================
FILE: src/Authentication/UserSessionState.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Authentication\UserSessionState.
 */

namespace Drupal\restful\Authentication;

/**
 * Class UserSessionState.
 *
 * @package Drupal\restful\Authentication
 */
class UserSessionState implements UserSessionStateInterface {

  /**
   * Boolean holding if this is the first switch.
   *
   * @var bool
   */
  protected static $isSwitched = FALSE;

  /**
   * Boolean holding if the session needs to be saved.
   *
   * @var bool
   */
  protected $needsSaving = FALSE;

  /**
   * Object holding the original user.
   *
   * This is saved for switch back purposes.
   *
   * @var object
   */
  protected $originalUser;

  /**
   * {@inheritdoc}
   */
  public static function isSwitched() {
    return static::$isSwitched;
  }

  /**
   * {@inheritdoc}
   */
  public function switchUser($account) {
    global $user;

    if (!static::isSwitched() && !$this->originalUser && !$this->needsSaving) {
      // This is the first time a user switched, and there isn't an original
      // user session.
      $this->needsSaving = drupal_save_session();
      $this->originalUser = $user;

      // Don't allow a session to be saved. Provider that require a session to
      // be saved, like the cookie provider, need to explicitly set
      // drupal_save_session(TRUE).
      // @see LoginCookie__1_0::loginUser().
      drupal_save_session(FALSE);
    }

    // Set the global user.
    $user = $account;
  }

  /**
   * Switch the user to the authenticated user, and back.
   *
   * This should be called only for an API call. It should not be used for calls
   * via the menu system, as it might be a login request, so we avoid switching
   * back to the anonymous user.
   */
  public function switchUserBack() {
    global $user;
    if (!$this->originalUser) {
      return;
    }

    $user = $this->originalUser;
    drupal_save_session($this->needsSaving);
    $this->reset();
  }

  /**
   * Reset the initial values.
   */
  protected function reset() {
    // Reset initial values.
    static::$isSwitched = FALSE;
    $this->originalUser = NULL;
    $this->needsSaving = FALSE;
  }

}


================================================
FILE: src/Authentication/UserSessionStateInterface.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Authentication\UserSessionStateInterface.
 */

namespace Drupal\restful\Authentication;

/**
 * Class UserSessionStateInterface.
 *
 * @package Drupal\restful\Authentication
 */
interface UserSessionStateInterface {

  /**
   * Check if the user has already been switched.
   *
   * We need this information to perform additional actions the first time a
   * user is switched.
   *
   * @return bool
   *   TRUE if the user has been switched previously. FALSE otherwise.
   */
  public static function isSwitched();

  /**
   * Make the passed in user to be the account for the Drupal thread.
   *
   * @param object $account
   *   The account to switch to.
   */
  public function switchUser($account);

  /**
   * Switch the user to the authenticated user, and back.
   *
   * This should be called only for an API call. It should not be used for calls
   * via the menu system, as it might be a login request, so we avoid switching
   * back to the anonymous user.
   */
  public function switchUserBack();

}


================================================
FILE: src/Exception/BadRequestException.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Exception\BadRequestException.
 */

namespace Drupal\restful\Exception;

class BadRequestException extends RestfulException {

  /**
   * Defines the HTTP error code.
   *
   * @var int
   */
  protected $code = 400;

  /**
   * {@inheritdoc}
   */
  protected $instance = 'help/restful/problem-instances-bad-request';

}


================================================
FILE: src/Exception/FloodException.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Exception\FloodException.
 */

namespace Drupal\restful\Exception;

class FloodException extends RestfulException {

  /**
   * Defines the HTTP error code.
   *
   * @var int
   */
  protected $code = 429;

  /**
   * {@inheritdoc}
   */
  protected $instance = 'help/restful/problem-instances-flood';

}


================================================
FILE: src/Exception/ForbiddenException.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Exception\ForbiddenException.
 */

namespace Drupal\restful\Exception;

class ForbiddenException extends RestfulException {

  /**
   * Defines the HTTP error code.
   *
   * @var int
   */
  protected $code = 403;

  /**
   * {@inheritdoc}
   */
  protected $instance = 'help/restful/problem-instances-forbidden';

}


================================================
FILE: src/Exception/GoneException.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Exception\GoneException.
 */

namespace Drupal\restful\Exception;

class GoneException extends RestfulException {

  /**
   * Defines the HTTP error code.
   *
   * @var int
   */
  protected $code = 410;

  /**
   * {@inheritdoc}
   */
  protected $description = 'The resource at this end point is no longer available.';

  /**
   * {@inheritdoc}
   */
  protected $instance = 'help/restful/problem-instances-gone';

}


================================================
FILE: src/Exception/InaccessibleRecordException.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Exception\InaccessibleRecordException.
 */

namespace Drupal\restful\Exception;

/**
 * Class InaccessibleRecordException.
 *
 * @package Drupal\restful\Exception
 */
class InaccessibleRecordException extends RestfulException {

  const ERROR_404_MESSAGE = 'Page not found.';

  /**
   * Instantiates a InaccessibleRecordException object.
   *
   * @param string $message
   *   The exception message.
   */
  public function __construct($message) {
    $show_access_denied = variable_get('restful_show_access_denied', FALSE);
    $this->message = $show_access_denied ? $message : static::ERROR_404_MESSAGE;
    $this->code = $show_access_denied ? 403 : 404;
    $this->instance = $show_access_denied ? 'help/restful/problem-instances-forbidden' : 'help/restful/problem-instances-not-found';
  }

}


================================================
FILE: src/Exception/IncompatibleFieldDefinitionException.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Exception\IncompatibleFieldDefinitionException.
 */

namespace Drupal\restful\Exception;

class IncompatibleFieldDefinitionException extends RestfulException {

  /**
   * Defines the HTTP error code.
   *
   * @var int
   */
  protected $code = 500;

  /**
   * {@inheritdoc}
   */
  protected $description = 'Incompatible field definition.';

  /**
   * {@inheritdoc}
   */
  protected $instance = 'help/restful/problem-instances-incompatible-field-definition';

}


================================================
FILE: src/Exception/InternalServerErrorException.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Exception\InternalServerErrorException
 */

namespace Drupal\restful\Exception;

class InternalServerErrorException extends RestfulException {


  /**
   * Defines the HTTP error code.
   *
   * @var int
   */
  protected $code = 500;

  /**
   * {@inheritdoc}
   */
  protected $instance = 'help/restful/problem-instances-server-configuration';

}


================================================
FILE: src/Exception/NotFoundException.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Exception\NotFoundException.
 */

namespace Drupal\restful\Exception;

class NotFoundException extends RestfulException {

  /**
   * Defines the HTTP error code.
   *
   * @var int
   */
  protected $code = 404;

  /**
   * {@inheritdoc}
   */
  protected $instance = 'help/restful/problem-instances-not-found';

}


================================================
FILE: src/Exception/NotImplementedException.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Exception\NotImplementedException.
 */

namespace Drupal\restful\Exception;

class NotImplementedException extends RestfulException {

  /**
   * Defines the HTTP error code.
   *
   * @var int
   */
  protected $code = 501;

  /**
   * {@inheritdoc}
   */
  protected $instance = 'help/restful/problem-instances-not-implemented';

}


================================================
FILE: src/Exception/RestfulException.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Exception\RestfulException.
 */

namespace Drupal\restful\Exception;

use Drupal\restful\Http\Response;

class RestfulException extends \Exception {

  /**
   * Defines the instance resource.
   *
   * @var string
   */
  protected $instance = NULL;

  /**
   * Array keyed by the field name, and array of error messages as value.
   *
   * @var array
   */
  protected $fieldErrors = array();

  /**
   * Array of extra headers to set when throwing an exception.
   *
   * @var array
   */
  protected $headers = array();

  /**
   * Exception description.
   *
   * @var string
   */
  protected $description = '';

  /**
   * Gets the description of the exception.
   *
   * @return string
   *   The description.
   */
  final public function getDescription() {
    return $this->description ? $this->description : Response::$statusTexts[$this->getCode()];
  }

  /**
   * Return a string to the common problem type.
   *
   * @return string
   *   URL pointing to the specific RFC-2616 section.
   */
  public function getType() {
    // Depending on the error code we'll return a different URL.
    $url = 'http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html';
    $sections = array(
      '100' => '#sec10.1.1',
      '101' => '#sec10.1.2',
      '200' => '#sec10.2.1',
      '201' => '#sec10.2.2',
      '202' => '#sec10.2.3',
      '203' => '#sec10.2.4',
      '204' => '#sec10.2.5',
      '205' => '#sec10.2.6',
      '206' => '#sec10.2.7',
      '300' => '#sec10.3.1',
      '301' => '#sec10.3.2',
      '302' => '#sec10.3.3',
      '303' => '#sec10.3.4',
      '304' => '#sec10.3.5',
      '305' => '#sec10.3.6',
      '307' => '#sec10.3.8',
      '400' => '#sec10.4.1',
      '401' => '#sec10.4.2',
      '402' => '#sec10.4.3',
      '403' => '#sec10.4.4',
      '404' => '#sec10.4.5',
      '405' => '#sec10.4.6',
      '406' => '#sec10.4.7',
      '407' => '#sec10.4.8',
      '408' => '#sec10.4.9',
      '409' => '#sec10.4.10',
      '410' => '#sec10.4.11',
      '411' => '#sec10.4.12',
      '412' => '#sec10.4.13',
      '413' => '#sec10.4.14',
      '414' => '#sec10.4.15',
      '415' => '#sec10.4.16',
      '416' => '#sec10.4.17',
      '417' => '#sec10.4.18',
      '500' => '#sec10.5.1',
      '501' => '#sec10.5.2',
      '502' => '#sec10.5.3',
      '503' => '#sec10.5.4',
      '504' => '#sec10.5.5',
      '505' => '#sec10.5.6',
    );
    return empty($sections[$this->getCode()]) ? $url : $url . $sections[$this->getCode()];
  }

  /**
   * Get the URL to the error for the particular case.
   *
   * @return string
   *   The url or NULL if empty.
   */
  public function getInstance() {
    // Handle all instances using the advanced help module.
    if (!module_exists('advanced_help') || empty($this->instance)) {
      return NULL;
    }
    return url($this->instance, array(
      'absolute' => TRUE,
    ));
  }

  /**
   * Return an array with all the errors.
   */
  public function getFieldErrors() {
    return $this->fieldErrors;
  }

  /**
   * Add an error per field.
   *
   * @param string $field_name
   *   The field name.
   * @param string $error_message
   *   The error message.
   */
  public function addFieldError($field_name, $error_message) {
    $this->fieldErrors[$field_name][] = $error_message;
  }

  /**
   * Get the associative array of headers.
   *
   * @return array
   *   The associated headers to the error exception.
   */
  public function getHeaders() {
    return $this->headers;
  }

  /**
   * Set a header.
   *
   * @param string $key
   *   The header name.
   * @param string $value
   *   The header value.
   */
  public function setHeader($key, $value) {
    $this->headers[$key] = $value;
  }

}


================================================
FILE: src/Exception/ServerConfigurationException.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Exception\ServerConfigurationException.
 */

namespace Drupal\restful\Exception;

class ServerConfigurationException extends RestfulException {

  /**
   * Defines the HTTP error code.
   *
   * @var int
   */
  protected $code = 500;

  /**
   * {@inheritdoc}
   */
  protected $description = 'Server configuration error.';

  /**
   * {@inheritdoc}
   */
  protected $instance = 'help/restful/problem-instances-server-configuration';

}


================================================
FILE: src/Exception/ServiceUnavailableException.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Exception\ServiceUnavailable.
 */

namespace Drupal\restful\Exception;

class ServiceUnavailableException extends RestfulException {

  /**
   * Defines the HTTP error code.
   *
   * @var int
   */
  protected $code = 503;

  /**
   * {@inheritdoc}
   */
  protected $instance = 'help/restful/problem-instances-bad-request';

}


================================================
FILE: src/Exception/UnauthorizedException.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Exception\UnauthorizedException.
 */

namespace Drupal\restful\Exception;

class UnauthorizedException extends RestfulException {

  /**
   * Defines the HTTP error code.
   *
   * @var int
   */
  protected $code = 401;

  /**
   * {@inheritdoc}
   */
  protected $instance = 'help/restful/problem-instances-unauthorized';

}


================================================
FILE: src/Exception/UnprocessableEntityException.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Exception\UnprocessableEntityException.
 */

namespace Drupal\restful\Exception;

class UnprocessableEntityException extends RestfulException {

  /**
   * Defines the HTTP error code.
   *
   * @var int
   */
  protected $code = 422;

  /**
   * {@inheritdoc}
   */
  protected $description = 'Unprocessable Entity; Validation errors.';


  /**
   * {@inheritdoc}
   */
  protected $instance = 'help/restful/problem-instances-unprocessable-entity';

}


================================================
FILE: src/Exception/UnsupportedMediaTypeException.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Exception\UnsupportedMediaTypeException.
 */

namespace Drupal\restful\Exception;

class UnsupportedMediaTypeException extends RestfulException {

  /**
   * Defines the HTTP error code.
   *
   * @var int
   */
  protected $code = 415;

  /**
   * {@inheritdoc}
   */
  protected $instance = 'help/restful/problem-instances-unsupported-media-type';

}


================================================
FILE: src/Formatter/FormatterManager.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Formatter\FormatterManager
 */

namespace Drupal\restful\Formatter;

use Drupal\restful\Exception\ServiceUnavailableException;
use Drupal\restful\Http\HttpHeader;
use Drupal\restful\Plugin\formatter\FormatterInterface;
use Drupal\restful\Plugin\resource\ResourceInterface;
use Drupal\restful\Plugin\FormatterPluginManager;
use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\restful\Resource\ResourceManager;

/**
 * Class FormatterManager.
 *
 * @package Drupal\restful\Formatter
 */
class FormatterManager implements FormatterManagerInterface {

  /**
   * The rate limit plugins.
   *
   * @var FormatterPluginCollection
   */
  protected $plugins;

  /**
   * The resource.
   *
   * @todo: Remove this coupling.
   *
   * @var ResourceInterface
   */
  protected $resource;

  /**
   * Constructs FormatterManager.
   *
   * @param ResourceInterface $resource
   *   TODO: Remove this coupling.
   *   The resource.
   */
  public function __construct($resource = NULL) {
    $this->resource = $resource;
    $manager = FormatterPluginManager::create();
    $options = array();
    foreach ($manager->getDefinitions() as $plugin_id => $plugin_definition) {
      // Since there is only one instance per plugin_id use the plugin_id as
      // instance_id.
      $options[$plugin_id] = $plugin_definition;
    }
    $this->plugins = new FormatterPluginCollection($manager, $options);
  }

  /**
   * {@inheritdoc}
   */
  public function setResource($resource) {
    $this->resource = $resource;
  }

  /**
   * {@inheritdoc}
   */
  public function format(array $data, $formatter_name = NULL) {
    return $this->processData('format', $data, $formatter_name);
  }

  /**
   * {@inheritdoc}
   */
  public function render(array $data, $formatter_name = NULL) {
    return $this->processData('render', $data, $formatter_name);
  }

  /**
   * {@inheritdoc}
   */
  public function negotiateFormatter($accept, $formatter_name = NULL) {
    $message = 'Formatter plugin class was not found.';
    $default_formatter_name = variable_get('restful_default_output_formatter', 'json');
    try {
      if ($formatter_name) {
        return $this->getPluginByName($formatter_name);
      }
      // Sometimes we will get a default Accept: */* in that case we want to
      // return the default content type and not just any.
      if (empty($accept) || $accept == '*/*') {
        // Return the default formatter.
        return $this->getPluginByName($default_formatter_name);
      }
      foreach (explode(',', $accept) as $accepted_content_type) {
        // Loop through all the formatters and find the first one that matches
        // the Content-Type header.
        $accepted_content_type = trim($accepted_content_type);
        if (strpos($accepted_content_type, '*/*') === 0) {
          return $this->getPluginByName($default_formatter_name);
        }
        foreach ($this->plugins as $formatter_name => $formatter) {
          /* @var FormatterInterface $formatter */
          if (static::matchContentType($formatter->getContentTypeHeader(), $accepted_content_type)) {
            $formatter->setConfiguration(array(
              'resource' => $this->resource,
            ));
            return $formatter;
          }
        }
      }
    }
    catch (PluginNotFoundException $e) {
      // Catch the exception and throw one of our own.
      $message = $e->getMessage();
    }
    throw new ServiceUnavailableException($message);
  }

  /**
   * Helper function to get a formatter and apply a method.
   *
   * @param string $method
   *   A valid method to call on the FormatterInterface object.
   * @param array $data
   *   The array of data to process.
   * @param string $formatter_name
   *   The name of the formatter for the current resource. Leave it NULL to use
   *   the Accept headers.
   *
   * @return string
   *   The processed output.
   */
  protected function processData($method, array $data, $formatter_name = NULL) {
    if ($resource = $this->resource) {
      $request = $resource->getRequest();
    }
    else {
      $request = restful()->getRequest();
    }
    $accept = $request
      ->getHeaders()
      ->get('accept')
      ->getValueString();
    $formatter = $this->negotiateFormatter($accept, $formatter_name);
    $output = ResourceManager::executeCallback(array($formatter, $method), array($data, $formatter_name));

    // The content type header is modified after the massaging if there is
    // an error code. Therefore we need to set the content type header after
    // formatting the output.
    $content_type = $formatter->getContentTypeHeader();
    $response_headers = restful()
      ->getResponse()
      ->getHeaders();
    $response_headers->add(HttpHeader::create('Content-Type', $content_type));

    return $output;
  }

  /**
   * Matches a string with path style wildcards.
   *
   * @param string $content_type
   *   The string to check.
   * @param string $pattern
   *   The pattern to check against.
   *
   * @return bool
   *   TRUE if the input matches the pattern.
   *
   * @see drupal_match_path().
   */
  protected static function matchContentType($content_type, $pattern) {
    $regexps = &drupal_static(__METHOD__);

    if (!isset($regexps[$pattern])) {
      // Convert path settings to a regular expression.
      $to_replace = array(
        '/\\\\\*/', // asterisks
      );
      $replacements = array(
        '.*',
      );
      $patterns_quoted = preg_quote($pattern, '/');

      // This will turn 'application/*' into '/^(application\/.*)(;.*)$/'
      // allowing us to match 'application/json; charset: utf8'
      $regexps[$pattern] = '/^(' . preg_replace($to_replace, $replacements, $patterns_quoted) . ')(;.*)?$/i';
    }
    return (bool) preg_match($regexps[$pattern], $content_type);
  }

  /**
   * {@inheritdocs}
   */
  public function getPlugins() {
    return $this->plugins;
  }

  /**
   * {@inheritdocs}
   */
  public function getPlugin($instance_id) {
    return $this->plugins->get($instance_id);
  }

  /**
   * Gets a plugin by name initializing the resource.
   *
   * @param string $name
   *   The formatter name.
   *
   * @return FormatterInterface
   *   The plugin.
   */
  protected function getPluginByName($name) {
    /* @var FormatterInterface $formatter */
    $formatter = $this->plugins->get($name);
    if ($this->resource) {
      $formatter->setResource($this->resource);
    }
    return $formatter;
  }

}


================================================
FILE: src/Formatter/FormatterManagerInterface.php
================================================
<?php

/**
 * @file
 * Contains \Drupal\restful\Formatter\FormatterManagerInterface
 */

namespace Drupal\restful\Formatter;

use Drupal\restful\Plugin\formatter\FormatterInterface;
use Drupal\restful\Plugin\resource\ResourceInterface;

interface FormatterManagerInterface {

  /**
   * Sets the resource.
   *
   * @param ResourceInterface $resource
   *   The resource.
   */
  public function setResource($resource);

  /**
   * Call the output format on the given data.
   *
   * @param array $data
   *   The array of data to format.
   * @param string $formatter_name
   *   The name of the formatter for the current resource. Leave it NULL to use
   *   the Accept headers.
   *
   * @return string
   *   The formatted output.
   */
  public function format(array $data, $formatter_name = NULL);

  /**
   * Call the output format on the given data.
   *
   * @param array $data
   *   The array of data to render.
   * @param string $formatter_name
   *   The name of the formatter for the current resource. Leave it NULL to use
   *   the Accept headers.
   *
   * @return string
   *   The rendered output.
   */
  public function render(array $data, $formatter_name = NULL);

  /**
   * Helper function to get the default output format from the current request.
   *
   * @param string $accept
   *   The Accept header.
   * @param string $formatter_name
   *   The name of the formatter for the current resource.
   *
   * @return FormatterInterface
   *   The formatter plugin to use.
   */
  public function negotiateFormatter($accept, $formatter_name = NULL);

  /**
   * Returns the plugins.
   *
   * @return FormatterPluginCollection
   */
  public function getPlugins();

  /**
   * Returns the plugin instance for the given instance ID.
   *
   * @return FormatterInterface
   */
  public function getPlugin($instanc
Download .txt
gitextract_cruhgny1/

├── .travis.yml
├── README.md
├── docs/
│   ├── api_drupal.md
│   ├── api_url.md
│   ├── documentation.md
│   └── plugin.md
├── help/
│   ├── problem-instances-bad-request.html
│   ├── problem-instances-flood.html
│   ├── problem-instances-forbidden.html
│   ├── problem-instances-gone.html
│   ├── problem-instances-incompatible-field-definition.html
│   ├── problem-instances-not-found.html
│   ├── problem-instances-not-implemented.html
│   ├── problem-instances-server-configuration.html
│   ├── problem-instances-server-error.html
│   ├── problem-instances-service-unavailable.html
│   ├── problem-instances-unauthorized.html
│   ├── problem-instances-unprocessable-entity.html
│   ├── problem-instances-unsupported-media-type.html
│   ├── problem-instances.html
│   ├── readme.html
│   └── restful.help.ini
├── modules/
│   ├── restful_example/
│   │   ├── restful_example.info
│   │   ├── restful_example.module
│   │   └── src/
│   │       └── Plugin/
│   │           ├── formatter/
│   │           │   └── FormatterHalXml.php
│   │           └── resource/
│   │               ├── Tags__1_0.php
│   │               ├── comment/
│   │               │   ├── Comments__1_0.php
│   │               │   └── DataProviderComment.php
│   │               ├── node/
│   │               │   └── article/
│   │               │       ├── v1/
│   │               │       │   ├── Articles__1_0.php
│   │               │       │   ├── Articles__1_1.php
│   │               │       │   ├── Articles__1_4.php
│   │               │       │   ├── Articles__1_5.php
│   │               │       │   ├── Articles__1_6.php
│   │               │       │   └── Articles__1_7.php
│   │               │       └── v2/
│   │               │           ├── Articles__2_0.php
│   │               │           └── Articles__2_1.php
│   │               └── variables/
│   │                   ├── DataInterpreterVariable.php
│   │                   ├── DataProviderVariable.php
│   │                   ├── DataProviderVariableInterface.php
│   │                   └── Variables__1_0.php
│   └── restful_token_auth/
│       ├── modules/
│       │   └── restful_token_auth_test/
│       │       ├── restful_token_auth_test.info
│       │       ├── restful_token_auth_test.module
│       │       └── src/
│       │           └── Plugin/
│       │               └── resource/
│       │                   └── Articles__1_3.php
│       ├── restful_token_auth.admin.inc
│       ├── restful_token_auth.info
│       ├── restful_token_auth.install
│       ├── restful_token_auth.module
│       ├── src/
│       │   ├── Entity/
│       │   │   ├── RestfulTokenAuth.php
│       │   │   └── RestfulTokenAuthController.php
│       │   └── Plugin/
│       │       ├── authentication/
│       │       │   └── TokenAuthentication.php
│       │       └── resource/
│       │           ├── AccessToken__1_0.php
│       │           ├── RefreshToken__1_0.php
│       │           └── TokenAuthenticationBase.php
│       └── tests/
│           └── RestfulTokenAuthenticationTestCase.test
├── restful.admin.inc
├── restful.api.php
├── restful.cache.inc
├── restful.entity.inc
├── restful.info
├── restful.install
├── restful.module
├── src/
│   ├── Annotation/
│   │   ├── Authentication.php
│   │   ├── Formatter.php
│   │   ├── RateLimit.php
│   │   └── Resource.php
│   ├── Authentication/
│   │   ├── AuthenticationManager.php
│   │   ├── AuthenticationManagerInterface.php
│   │   ├── AuthenticationPluginCollection.php
│   │   ├── UserSessionState.php
│   │   └── UserSessionStateInterface.php
│   ├── Exception/
│   │   ├── BadRequestException.php
│   │   ├── FloodException.php
│   │   ├── ForbiddenException.php
│   │   ├── GoneException.php
│   │   ├── InaccessibleRecordException.php
│   │   ├── IncompatibleFieldDefinitionException.php
│   │   ├── InternalServerErrorException.php
│   │   ├── NotFoundException.php
│   │   ├── NotImplementedException.php
│   │   ├── RestfulException.php
│   │   ├── ServerConfigurationException.php
│   │   ├── ServiceUnavailableException.php
│   │   ├── UnauthorizedException.php
│   │   ├── UnprocessableEntityException.php
│   │   └── UnsupportedMediaTypeException.php
│   ├── Formatter/
│   │   ├── FormatterManager.php
│   │   ├── FormatterManagerInterface.php
│   │   └── FormatterPluginCollection.php
│   ├── Http/
│   │   ├── HttpHeader.php
│   │   ├── HttpHeaderBag.php
│   │   ├── HttpHeaderBagInterface.php
│   │   ├── HttpHeaderInterface.php
│   │   ├── HttpHeaderNull.php
│   │   ├── Request.php
│   │   ├── RequestInterface.php
│   │   ├── Response.php
│   │   └── ResponseInterface.php
│   ├── Plugin/
│   │   ├── AuthenticationPluginManager.php
│   │   ├── ConfigurablePluginTrait.php
│   │   ├── FormatterPluginManager.php
│   │   ├── RateLimitPluginManager.php
│   │   ├── ResourcePluginManager.php
│   │   ├── SemiSingletonTrait.php
│   │   ├── authentication/
│   │   │   ├── Authentication.php
│   │   │   ├── AuthenticationInterface.php
│   │   │   ├── BasicAuthentication.php
│   │   │   ├── CookieAuthentication.php
│   │   │   └── OAuth2ServerAuthentication.php
│   │   ├── formatter/
│   │   │   ├── Formatter.php
│   │   │   ├── FormatterHalJson.php
│   │   │   ├── FormatterInterface.php
│   │   │   ├── FormatterJson.php
│   │   │   ├── FormatterJsonApi.php
│   │   │   └── FormatterSingleJson.php
│   │   ├── rate_limit/
│   │   │   ├── RateLimit.php
│   │   │   ├── RateLimitGlobal.php
│   │   │   ├── RateLimitInterface.php
│   │   │   └── RateLimitRequest.php
│   │   └── resource/
│   │       ├── AuthenticatedResource.php
│   │       ├── AuthenticatedResourceInterface.php
│   │       ├── CrudInterface.php
│   │       ├── CsrfToken.php
│   │       ├── DataInterpreter/
│   │       │   ├── ArrayWrapper.php
│   │       │   ├── ArrayWrapperInterface.php
│   │       │   ├── DataInterpreterArray.php
│   │       │   ├── DataInterpreterBase.php
│   │       │   ├── DataInterpreterEMW.php
│   │       │   ├── DataInterpreterInterface.php
│   │       │   ├── DataInterpreterPlug.php
│   │       │   ├── PluginWrapper.php
│   │       │   └── PluginWrapperInterface.php
│   │       ├── DataProvider/
│   │       │   ├── CacheDecoratedDataProvider.php
│   │       │   ├── CacheDecoratedDataProviderInterface.php
│   │       │   ├── DataProvider.php
│   │       │   ├── DataProviderDbQuery.php
│   │       │   ├── DataProviderDbQueryInterface.php
│   │       │   ├── DataProviderDecorator.php
│   │       │   ├── DataProviderEntity.php
│   │       │   ├── DataProviderEntityDecorator.php
│   │       │   ├── DataProviderEntityInterface.php
│   │       │   ├── DataProviderFile.php
│   │       │   ├── DataProviderInterface.php
│   │       │   ├── DataProviderNode.php
│   │       │   ├── DataProviderNull.php
│   │       │   ├── DataProviderPlug.php
│   │       │   ├── DataProviderResource.php
│   │       │   ├── DataProviderResourceInterface.php
│   │       │   └── DataProviderTaxonomyTerm.php
│   │       ├── Decorators/
│   │       │   ├── CacheDecoratedResource.php
│   │       │   ├── CacheDecoratedResourceInterface.php
│   │       │   ├── RateLimitDecoratedResource.php
│   │       │   ├── ResourceDecoratorBase.php
│   │       │   └── ResourceDecoratorInterface.php
│   │       ├── Discovery.php
│   │       ├── Field/
│   │       │   ├── PublicFieldInfo/
│   │       │   │   ├── PublicFieldInfoBase.php
│   │       │   │   ├── PublicFieldInfoEntity.php
│   │       │   │   ├── PublicFieldInfoEntityInterface.php
│   │       │   │   ├── PublicFieldInfoInterface.php
│   │       │   │   └── PublicFieldInfoNull.php
│   │       │   ├── ResourceField.php
│   │       │   ├── ResourceFieldBase.php
│   │       │   ├── ResourceFieldCollection.php
│   │       │   ├── ResourceFieldCollectionInterface.php
│   │       │   ├── ResourceFieldDbColumn.php
│   │       │   ├── ResourceFieldDbColumnInterface.php
│   │       │   ├── ResourceFieldEntity.php
│   │       │   ├── ResourceFieldEntityAlterableInterface.php
│   │       │   ├── ResourceFieldEntityFile.php
│   │       │   ├── ResourceFieldEntityInterface.php
│   │       │   ├── ResourceFieldEntityReference.php
│   │       │   ├── ResourceFieldEntityReferenceInterface.php
│   │       │   ├── ResourceFieldEntityText.php
│   │       │   ├── ResourceFieldFileEntityReference.php
│   │       │   ├── ResourceFieldInterface.php
│   │       │   ├── ResourceFieldKeyValue.php
│   │       │   ├── ResourceFieldReference.php
│   │       │   ├── ResourceFieldResource.php
│   │       │   └── ResourceFieldResourceInterface.php
│   │       ├── FilesUpload__1_0.php
│   │       ├── LoginCookie__1_0.php
│   │       ├── Resource.php
│   │       ├── ResourceDbQuery.php
│   │       ├── ResourceEntity.php
│   │       ├── ResourceInterface.php
│   │       ├── ResourceNode.php
│   │       └── Users__1_0.php
│   ├── RateLimit/
│   │   ├── Entity/
│   │   │   ├── RateLimit.php
│   │   │   └── RateLimitController.php
│   │   ├── RateLimitManager.php
│   │   ├── RateLimitManagerInterface.php
│   │   └── RateLimitPluginCollection.php
│   ├── RenderCache/
│   │   ├── Entity/
│   │   │   ├── CacheFragment.php
│   │   │   └── CacheFragmentController.php
│   │   ├── RenderCache.php
│   │   └── RenderCacheInterface.php
│   ├── Resource/
│   │   ├── EnabledArrayIterator.php
│   │   ├── ResourceManager.php
│   │   ├── ResourceManagerInterface.php
│   │   └── ResourcePluginCollection.php
│   ├── RestfulManager.php
│   └── Util/
│       ├── EntityFieldQuery.php
│       ├── EntityFieldQueryRelationalConditionsInterface.php
│       ├── ExplorableDecoratorInterface.php
│       ├── PersistableCache.php
│       ├── PersistableCacheInterface.php
│       ├── RelationalFilter.php
│       ├── RelationalFilterInterface.php
│       └── StringHelper.php
└── tests/
    ├── RestfulAuthenticationTestCase.test
    ├── RestfulAutoCompleteTestCase.test
    ├── RestfulCommentTestCase.test
    ├── RestfulCreateEntityTestCase.test
    ├── RestfulCreateNodeTestCase.test
    ├── RestfulCreatePrivateNodeTestCase.test
    ├── RestfulCreateTaxonomyTermTestCase.test
    ├── RestfulCsrfTokenTestCase.test
    ├── RestfulCurlBaseTestCase.test
    ├── RestfulDataProviderPlugPluginsTestCase.test
    ├── RestfulDbQueryTestCase.test
    ├── RestfulDiscoveryTestCase.test
    ├── RestfulEntityAndPropertyAccessTestCase.test
    ├── RestfulEntityUserAccessTestCase.test
    ├── RestfulEntityValidatorTestCase.test
    ├── RestfulExceptionHandleTestCase.test
    ├── RestfulForbiddenItemsTestCase.test
    ├── RestfulGetHandlersTestCase.test
    ├── RestfulHalJsonTestCase.test
    ├── RestfulHookMenuTestCase.test
    ├── RestfulJsonApiTestCase.test
    ├── RestfulListEntityMultipleBundlesTestCase.test
    ├── RestfulListTestCase.test
    ├── RestfulPassThroughTestCase.test
    ├── RestfulRateLimitTestCase.test
    ├── RestfulReferenceTestCase.test
    ├── RestfulRenderCacheTestCase.test
    ├── RestfulSimpleJsonTestCase.test
    ├── RestfulSubResourcesCreateEntityTestCase.test
    ├── RestfulUpdateEntityCurlTestCase.test
    ├── RestfulUpdateEntityTestCase.test
    ├── RestfulUserLoginCookieTestCase.test
    ├── RestfulVariableTestCase.test
    ├── RestfulViewEntityMultiLingualTestCase.test
    ├── RestfulViewEntityTestCase.test
    ├── RestfulViewModeAndFormatterTestCase.test
    └── modules/
        ├── restful_node_access_test/
        │   ├── restful_node_access_test.info
        │   └── restful_node_access_test.module
        └── restful_test/
            ├── restful_test.info
            ├── restful_test.install
            ├── restful_test.module
            └── src/
                └── Plugin/
                    └── resource/
                        ├── DataProvider/
                        │   └── DataProviderFileTest.php
                        ├── db_query_test/
                        │   └── v1/
                        │       └── DbQueryTest__1_0.php
                        ├── entity_test/
                        │   ├── EntityTests__1_0.php
                        │   ├── main/
                        │   │   └── v1/
                        │   │       ├── Main__1_0.php
                        │   │       ├── Main__1_1.php
                        │   │       ├── Main__1_2.php
                        │   │       ├── Main__1_3.php
                        │   │       ├── Main__1_4.php
                        │   │       ├── Main__1_5.php
                        │   │       ├── Main__1_6.php
                        │   │       ├── Main__1_7.php
                        │   │       └── Main__1_8.php
                        │   └── tests/
                        │       └── Tests__1_0.php
                        ├── file/
                        │   └── file_upload_test/
                        │       └── v1/
                        │           └── FilesUploadTest__1_0.php
                        ├── node/
                        │   └── test_article/
                        │       └── v1/
                        │           ├── TestArticles__1_0.php
                        │           ├── TestArticles__1_1.php
                        │           ├── TestArticles__1_2.php
                        │           ├── TestArticles__1_3.php
                        │           └── TestArticles__1_4.php
                        ├── restful_test_translatable_entity/
                        │   └── v1/
                        │       └── RestfulTestTranslatableEntityResource__1_0.php
                        └── taxonomy_term/
                            └── v1/
                                ├── DataProviderTaxonomyTerm.php
                                └── TestTags__1_0.php
Download .txt
SYMBOL INDEX (1485 symbols across 193 files)

FILE: modules/restful_example/src/Plugin/formatter/FormatterHalXml.php
  class FormatterHalXml (line 28) | class FormatterHalXml extends FormatterHalJson implements FormatterInter...
    method render (line 40) | public function render(array $structured_data) {
    method arrayToXML (line 54) | protected function arrayToXML(array $data, \SimpleXMLElement $xml) {

FILE: modules/restful_example/src/Plugin/resource/Tags__1_0.php
  class Tags__1_0 (line 36) | class Tags__1_0 extends ResourceEntity implements ResourceInterface {
    method checkEntityAccess (line 45) | protected function checkEntityAccess($op, $entity_type, $entity) {

FILE: modules/restful_example/src/Plugin/resource/comment/Comments__1_0.php
  class Comments__1_0 (line 32) | class Comments__1_0 extends ResourceEntity implements ResourceInterface {
    method publicFields (line 37) | protected function publicFields() {
    method dataProviderClassName (line 59) | protected function dataProviderClassName() {

FILE: modules/restful_example/src/Plugin/resource/comment/DataProviderComment.php
  class DataProviderComment (line 13) | class DataProviderComment  extends DataProviderEntity implements DataPro...
    method setPropertyValues (line 23) | protected function setPropertyValues(\EntityDrupalWrapper $wrapper, $o...
    method getQueryForList (line 44) | public function getQueryForList() {
    method getQueryCount (line 55) | public function getQueryCount() {
    method entityPreSave (line 64) | public function entityPreSave(\EntityDrupalWrapper $wrapper) {

FILE: modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_0.php
  class Articles__1_0 (line 36) | class Articles__1_0 extends ResourceNode implements ResourceInterface {}

FILE: modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_1.php
  class Articles__1_1 (line 34) | class Articles__1_1 extends Articles__1_0 implements ResourceInterface {
    method publicFields (line 39) | protected function publicFields() {

FILE: modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_4.php
  class Articles__1_4 (line 35) | class Articles__1_4 extends ResourceNode implements ResourceInterface {
    method __construct (line 47) | public function __construct(array $configuration, $plugin_id, $plugin_...

FILE: modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_5.php
  class Articles__1_5 (line 36) | class Articles__1_5 extends ResourceNode implements ResourceInterface {
    method publicFields (line 41) | protected function publicFields() {
    method imageProcess (line 106) | public function imageProcess($value) {
    method randomNumber (line 134) | public static function randomNumber(DataInterpreterInterface $interpre...

FILE: modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_6.php
  class Articles__1_6 (line 35) | class Articles__1_6 extends ResourceNode implements ResourceInterface {
    method publicFields (line 40) | protected function publicFields() {

FILE: modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_7.php
  class Articles__1_7 (line 42) | class Articles__1_7 extends ResourceNode implements ResourceInterface {}

FILE: modules/restful_example/src/Plugin/resource/node/article/v2/Articles__2_0.php
  class Articles__2_0 (line 33) | class Articles__2_0 extends ResourceNode implements ResourceInterface {}

FILE: modules/restful_example/src/Plugin/resource/node/article/v2/Articles__2_1.php
  class Articles__2_1 (line 35) | class Articles__2_1 extends ResourceNode implements ResourceInterface {
    method publicFields (line 41) | protected function publicFields() {

FILE: modules/restful_example/src/Plugin/resource/variables/DataInterpreterVariable.php
  class DataInterpreterVariable (line 12) | class DataInterpreterVariable extends DataInterpreterBase {}

FILE: modules/restful_example/src/Plugin/resource/variables/DataProviderVariable.php
  class DataProviderVariable (line 24) | class DataProviderVariable extends DataProvider implements DataProviderI...
    method __construct (line 29) | public function __construct(RequestInterface $request, ResourceFieldCo...
    method count (line 43) | public function count() {
    method create (line 50) | public function create($object) {
    method view (line 69) | public function view($identifier) {
    method viewMultiple (line 97) | public function viewMultiple(array $identifiers) {
    method update (line 115) | public function update($identifier, $object, $replace = FALSE) {
    method remove (line 138) | public function remove($identifier) {
    method getIndexIds (line 145) | public function getIndexIds() {
    method applyFilters (line 168) | protected function applyFilters(array $variables) {
    method applySort (line 200) | protected function applySort(array $variables) {
    method initDataInterpreter (line 225) | protected function initDataInterpreter($identifier) {
    method searchPublicFieldByProperty (line 241) | protected function searchPublicFieldByProperty($property) {

FILE: modules/restful_example/src/Plugin/resource/variables/DataProviderVariableInterface.php
  type DataProviderVariableInterface (line 12) | interface DataProviderVariableInterface extends DataProviderInterface {}

FILE: modules/restful_example/src/Plugin/resource/variables/Variables__1_0.php
  class Variables__1_0 (line 34) | class Variables__1_0 extends Resource implements ResourceInterface {
    method publicFields (line 39) | protected function publicFields() {
    method dataProviderClassName (line 49) | protected function dataProviderClassName() {

FILE: modules/restful_token_auth/modules/restful_token_auth_test/src/Plugin/resource/Articles__1_3.php
  class Articles__1_3 (line 35) | class Articles__1_3 extends ResourceNode implements ResourceInterface {}

FILE: modules/restful_token_auth/src/Entity/RestfulTokenAuth.php
  class RestfulTokenAuth (line 10) | class RestfulTokenAuth extends \Entity {}

FILE: modules/restful_token_auth/src/Entity/RestfulTokenAuthController.php
  class RestfulTokenAuthController (line 12) | class RestfulTokenAuthController extends \EntityAPIController {
    method generateAccessToken (line 23) | public function generateAccessToken($uid) {
    method generateRefreshToken (line 58) | private function generateRefreshToken($uid) {
    method getExpireTime (line 95) | protected function getExpireTime() {

FILE: modules/restful_token_auth/src/Plugin/authentication/TokenAuthentication.php
  class TokenAuthentication (line 26) | class TokenAuthentication extends Authentication {
    method applies (line 31) | public function applies(RequestInterface $request) {
    method authenticate (line 38) | public function authenticate(RequestInterface $request) {
    method extractToken (line 85) | protected function extractToken(RequestInterface $request) {

FILE: modules/restful_token_auth/src/Plugin/resource/AccessToken__1_0.php
  class AccessToken__1_0 (line 40) | class AccessToken__1_0 extends TokenAuthenticationBase implements Resour...
    method controllersInfo (line 45) | public function controllersInfo() {
    method getOrCreateToken (line 58) | public function getOrCreateToken() {

FILE: modules/restful_token_auth/src/Plugin/resource/RefreshToken__1_0.php
  class RefreshToken__1_0 (line 39) | class RefreshToken__1_0 extends TokenAuthenticationBase implements Resou...
    method controllersInfo (line 44) | public function controllersInfo() {
    method refreshToken (line 64) | public function refreshToken($token) {

FILE: modules/restful_token_auth/src/Plugin/resource/TokenAuthenticationBase.php
  class TokenAuthenticationBase (line 13) | abstract class TokenAuthenticationBase extends ResourceEntity implements...
    method publicFields (line 20) | public function publicFields() {
    method intervalInSeconds (line 56) | public static function intervalInSeconds($value) {
    method getTokenFromEntity (line 70) | public static function getTokenFromEntity($token_id) {

FILE: restful.api.php
  function hook_restful_parse_request_alter (line 20) | function hook_restful_parse_request_alter(\Drupal\restful\Http\RequestIn...
  function hook_restful_resource_alter (line 31) | function hook_restful_resource_alter(\Drupal\restful\Plugin\resource\Res...

FILE: src/Annotation/Authentication.php
  class Authentication (line 19) | class Authentication extends Plugin {

FILE: src/Annotation/Formatter.php
  class Formatter (line 19) | class Formatter extends Plugin {

FILE: src/Annotation/RateLimit.php
  class RateLimit (line 19) | class RateLimit extends Plugin {

FILE: src/Annotation/Resource.php
  class Resource (line 19) | class Resource extends Plugin {
    method getId (line 147) | public function getId() {

FILE: src/Authentication/AuthenticationManager.php
  class AuthenticationManager (line 20) | class AuthenticationManager implements AuthenticationManagerInterface {
    method __construct (line 59) | public function __construct(AuthenticationPluginManager $manager = NUL...
    method setIsOptional (line 67) | public function setIsOptional($is_optional) {
    method getIsOptional (line 74) | public function getIsOptional() {
    method addAuthenticationProvider (line 81) | public function addAuthenticationProvider($plugin_id) {
    method addAllAuthenticationProviders (line 92) | public function addAllAuthenticationProviders() {
    method getAccount (line 102) | public function getAccount(RequestInterface $request, $cache = TRUE) {
    method setAccount (line 157) | public function setAccount($account) {
    method switchUserBack (line 167) | public function switchUserBack() {
    method getPlugins (line 174) | public function getPlugins() {
    method getPlugin (line 181) | public function getPlugin($instance_id) {
    method setAccessTime (line 193) | protected function setAccessTime($account) {

FILE: src/Authentication/AuthenticationManagerInterface.php
  type AuthenticationManagerInterface (line 16) | interface AuthenticationManagerInterface {
    method setIsOptional (line 24) | public function setIsOptional($is_optional);
    method getIsOptional (line 32) | public function getIsOptional();
    method addAuthenticationProvider (line 40) | public function addAuthenticationProvider($plugin_id);
    method addAllAuthenticationProviders (line 45) | public function addAllAuthenticationProviders();
    method getAccount (line 61) | public function getAccount(RequestInterface $request, $cache = TRUE);
    method setAccount (line 69) | public function setAccount($account);
    method switchUserBack (line 74) | public function switchUserBack();
    method getPlugins (line 82) | public function getPlugins();
    method getPlugin (line 96) | public function getPlugin($instance_id);

FILE: src/Authentication/AuthenticationPluginCollection.php
  class AuthenticationPluginCollection (line 12) | class AuthenticationPluginCollection extends DefaultLazyPluginCollection {}

FILE: src/Authentication/UserSessionState.php
  class UserSessionState (line 15) | class UserSessionState implements UserSessionStateInterface {
    method isSwitched (line 43) | public static function isSwitched() {
    method switchUser (line 50) | public function switchUser($account) {
    method switchUserBack (line 77) | public function switchUserBack() {
    method reset (line 91) | protected function reset() {

FILE: src/Authentication/UserSessionStateInterface.php
  type UserSessionStateInterface (line 15) | interface UserSessionStateInterface {
    method isSwitched (line 26) | public static function isSwitched();
    method switchUser (line 34) | public function switchUser($account);
    method switchUserBack (line 43) | public function switchUserBack();

FILE: src/Exception/BadRequestException.php
  class BadRequestException (line 10) | class BadRequestException extends RestfulException {

FILE: src/Exception/FloodException.php
  class FloodException (line 10) | class FloodException extends RestfulException {

FILE: src/Exception/ForbiddenException.php
  class ForbiddenException (line 10) | class ForbiddenException extends RestfulException {

FILE: src/Exception/GoneException.php
  class GoneException (line 10) | class GoneException extends RestfulException {

FILE: src/Exception/InaccessibleRecordException.php
  class InaccessibleRecordException (line 15) | class InaccessibleRecordException extends RestfulException {
    method __construct (line 25) | public function __construct($message) {

FILE: src/Exception/IncompatibleFieldDefinitionException.php
  class IncompatibleFieldDefinitionException (line 10) | class IncompatibleFieldDefinitionException extends RestfulException {

FILE: src/Exception/InternalServerErrorException.php
  class InternalServerErrorException (line 10) | class InternalServerErrorException extends RestfulException {

FILE: src/Exception/NotFoundException.php
  class NotFoundException (line 10) | class NotFoundException extends RestfulException {

FILE: src/Exception/NotImplementedException.php
  class NotImplementedException (line 10) | class NotImplementedException extends RestfulException {

FILE: src/Exception/RestfulException.php
  class RestfulException (line 12) | class RestfulException extends \Exception {
    method getDescription (line 48) | final public function getDescription() {
    method getType (line 58) | public function getType() {
    method getInstance (line 112) | public function getInstance() {
    method getFieldErrors (line 125) | public function getFieldErrors() {
    method addFieldError (line 137) | public function addFieldError($field_name, $error_message) {
    method getHeaders (line 147) | public function getHeaders() {
    method setHeader (line 159) | public function setHeader($key, $value) {

FILE: src/Exception/ServerConfigurationException.php
  class ServerConfigurationException (line 10) | class ServerConfigurationException extends RestfulException {

FILE: src/Exception/ServiceUnavailableException.php
  class ServiceUnavailableException (line 10) | class ServiceUnavailableException extends RestfulException {

FILE: src/Exception/UnauthorizedException.php
  class UnauthorizedException (line 10) | class UnauthorizedException extends RestfulException {

FILE: src/Exception/UnprocessableEntityException.php
  class UnprocessableEntityException (line 10) | class UnprocessableEntityException extends RestfulException {

FILE: src/Exception/UnsupportedMediaTypeException.php
  class UnsupportedMediaTypeException (line 10) | class UnsupportedMediaTypeException extends RestfulException {

FILE: src/Formatter/FormatterManager.php
  class FormatterManager (line 23) | class FormatterManager implements FormatterManagerInterface {
    method __construct (line 48) | public function __construct($resource = NULL) {
    method setResource (line 63) | public function setResource($resource) {
    method format (line 70) | public function format(array $data, $formatter_name = NULL) {
    method render (line 77) | public function render(array $data, $formatter_name = NULL) {
    method negotiateFormatter (line 84) | public function negotiateFormatter($accept, $formatter_name = NULL) {
    method processData (line 136) | protected function processData($method, array $data, $formatter_name =...
    method matchContentType (line 175) | protected static function matchContentType($content_type, $pattern) {
    method getPlugins (line 198) | public function getPlugins() {
    method getPlugin (line 205) | public function getPlugin($instance_id) {
    method getPluginByName (line 218) | protected function getPluginByName($name) {

FILE: src/Formatter/FormatterManagerInterface.php
  type FormatterManagerInterface (line 13) | interface FormatterManagerInterface {
    method setResource (line 21) | public function setResource($resource);
    method format (line 35) | public function format(array $data, $formatter_name = NULL);
    method render (line 49) | public function render(array $data, $formatter_name = NULL);
    method negotiateFormatter (line 62) | public function negotiateFormatter($accept, $formatter_name = NULL);
    method getPlugins (line 69) | public function getPlugins();
    method getPlugin (line 76) | public function getPlugin($instance_id);

FILE: src/Formatter/FormatterPluginCollection.php
  class FormatterPluginCollection (line 12) | class FormatterPluginCollection extends DefaultLazyPluginCollection {}

FILE: src/Http/HttpHeader.php
  class HttpHeader (line 10) | class HttpHeader implements HttpHeaderInterface {
    method __construct (line 43) | public function __construct($name, array $values, $extras) {
    method create (line 53) | public static function create($key, $value) {
    method get (line 61) | public function get() {
    method getValueString (line 68) | public function getValueString() {
    method getName (line 78) | public function getName() {
    method __toString (line 87) | public function __toString() {
    method set (line 94) | public function set($values) {
    method append (line 101) | public function append($value) {
    method getId (line 112) | public function getId() {
    method generateId (line 119) | public static function generateId($name) {
    method parseHeaderValue (line 131) | protected static function parseHeaderValue($value) {

FILE: src/Http/HttpHeaderBag.php
  class HttpHeaderBag (line 10) | class HttpHeaderBag implements HttpHeaderBagInterface, \Iterator {
    method __construct (line 25) | public function __construct($headers = array()) {
    method __toString (line 38) | public function __toString() {
    method get (line 50) | public function get($key) {
    method has (line 68) | public function has($key) {
    method getValues (line 75) | public function getValues() {
    method add (line 82) | public function add(HttpHeaderInterface $header) {
    method append (line 89) | public function append(HttpHeaderInterface $header) {
    method remove (line 105) | public function remove($key) {
    method current (line 120) | public function current() {
    method next (line 127) | public function next() {
    method key (line 134) | public function key() {
    method valid (line 141) | public function valid() {
    method rewind (line 149) | public function rewind() {

FILE: src/Http/HttpHeaderBagInterface.php
  type HttpHeaderBagInterface (line 12) | interface HttpHeaderBagInterface {
    method get (line 23) | public function get($key);
    method has (line 34) | public function has($key);
    method getValues (line 41) | public function getValues();
    method add (line 51) | public function add(HttpHeaderInterface $header);
    method append (line 61) | public function append(HttpHeaderInterface $header);
    method remove (line 69) | public function remove($key);

FILE: src/Http/HttpHeaderInterface.php
  type HttpHeaderInterface (line 10) | interface HttpHeaderInterface {
    method create (line 23) | public static function create($key, $value);
    method get (line 31) | public function get();
    method getValueString (line 39) | public function getValueString();
    method getName (line 46) | public function getName();
    method set (line 54) | public function set($values);
    method append (line 62) | public function append($value);
    method getId (line 70) | public function getId();
    method generateId (line 81) | public static function generateId($name);

FILE: src/Http/HttpHeaderNull.php
  class HttpHeaderNull (line 10) | class HttpHeaderNull implements HttpHeaderInterface {
    method __construct (line 43) | public function __construct($name, array $values, $extras) {}
    method create (line 48) | public static function create($key, $value) {
    method get (line 55) | public function get() {
    method getValueString (line 62) | public function getValueString() {
    method getName (line 69) | public function getName() {
    method __toString (line 78) | public function __toString() {
    method set (line 85) | public function set($values) {}
    method append (line 90) | public function append($value) {}
    method getId (line 95) | public function getId() {
    method generateId (line 102) | public static function generateId($name) {

FILE: src/Http/Request.php
  class Request (line 15) | class Request implements RequestInterface {
    method __construct (line 139) | public function __construct($path, array $query, $method = 'GET', Http...
    method create (line 160) | public static function create($path, array $query = array(), $method =...
    method createFromGlobals (line 176) | public static function createFromGlobals() {
    method isWriteMethod (line 193) | public static function isWriteMethod($method) {
    method isReadMethod (line 206) | public static function isReadMethod($method) {
    method isValidMethod (line 220) | public static function isValidMethod($method) {
    method isListRequest (line 228) | public function isListRequest($resource_path) {
    method getParsedBody (line 238) | public function getParsedBody() {
    method getParsedInput (line 250) | public function getParsedInput() {
    method getPagerInput (line 263) | public function getPagerInput() {
    method setParsedInput (line 283) | public function setParsedInput(array $input) {
    method parseBody (line 296) | protected function parseBody($method) {
    method parseBodyContentType (line 321) | protected static function parseBodyContentType($content_type) {
    method parseInput (line 343) | protected static function parseInput() {
    method fixQueryFields (line 360) | protected function fixQueryFields(array $input) {
    method parseHeadersFromGlobals (line 386) | protected static function parseHeadersFromGlobals() {
    method getPath (line 417) | public function getPath($strip = TRUE) {
    method href (line 428) | public function href() {
    method getHeaders (line 438) | public function getHeaders() {
    method getCredentials (line 448) | protected static function getCredentials() {
    method getUser (line 474) | public function getUser() {
    method getPassword (line 482) | public function getPassword() {
    method getMethod (line 490) | public function getMethod() {
    method setMethod (line 497) | public function setMethod($method) {
    method getServer (line 504) | public function getServer() {
    method setApplicationData (line 511) | public function setApplicationData($key, $value) {
    method clearApplicationData (line 518) | public function clearApplicationData() {
    method getApplicationData (line 525) | public function getApplicationData($key) {
    method isSecure (line 535) | public function isSecure() {
    method getCookies (line 546) | public function getCookies() {
    method getFiles (line 553) | public function getFiles() {
    method getCsrfToken (line 560) | public function getCsrfToken() {
    method isViaRouter (line 567) | public function isViaRouter() {
    method setViaRouter (line 574) | public function setViaRouter($via_router) {

FILE: src/Http/RequestInterface.php
  type RequestInterface (line 10) | interface RequestInterface {
    method createFromGlobals (line 34) | public static function createFromGlobals();
    method create (line 62) | public static function create($path, array $query = array(), $method =...
    method isWriteMethod (line 73) | public static function isWriteMethod($method);
    method isReadMethod (line 84) | public static function isReadMethod($method);
    method isValidMethod (line 95) | public static function isValidMethod($method);
    method isListRequest (line 106) | public function isListRequest($resource_path);
    method getParsedBody (line 114) | public function getParsedBody();
    method getParsedInput (line 122) | public function getParsedInput();
    method setParsedInput (line 130) | public function setParsedInput(array $input);
    method getPath (line 141) | public function getPath($strip = TRUE);
    method href (line 149) | public function href();
    method getHeaders (line 156) | public function getHeaders();
    method getUser (line 164) | public function getUser();
    method getPassword (line 172) | public function getPassword();
    method getMethod (line 179) | public function getMethod();
    method setMethod (line 187) | public function setMethod($method);
    method getServer (line 194) | public function getServer();
    method setApplicationData (line 204) | public function setApplicationData($key, $value);
    method clearApplicationData (line 209) | public function clearApplicationData();
    method getApplicationData (line 220) | public function getApplicationData($key);
    method isSecure (line 237) | public function isSecure();
    method getFiles (line 245) | public function getFiles();
    method getCsrfToken (line 253) | public function getCsrfToken();
    method isViaRouter (line 261) | public function isViaRouter();
    method setViaRouter (line 269) | public function setViaRouter($via_router);
    method getCookies (line 274) | public function getCookies();
    method getPagerInput (line 286) | public function getPagerInput();

FILE: src/Http/Response.php
  class Response (line 15) | class Response implements ResponseInterface {
    method __construct (line 134) | public function __construct($content = '', $status = 200, $headers = a...
    method create (line 147) | public static function create($content = '', $status = 200, $headers =...
    method __toString (line 163) | public function __toString() {
    method isEmpty (line 175) | protected function isEmpty() {
    method isInformational (line 184) | protected function isInformational() {
    method isSuccessful (line 193) | protected function isSuccessful() {
    method isInvalid (line 202) | protected function isInvalid() {
    method prepare (line 209) | public function prepare(RequestInterface $request) {
    method setContent (line 257) | public function setContent($content) {
    method getContent (line 267) | public function getContent() {
    method setProtocolVersion (line 274) | public function setProtocolVersion($version) {
    method getProtocolVersion (line 281) | public function getProtocolVersion() {
    method send (line 288) | public function send() {
    method sendHeaders (line 298) | protected function sendHeaders() {
    method sendContent (line 309) | protected function sendContent() {
    method setStatusCode (line 316) | public function setStatusCode($code, $text = NULL) {
    method getStatusCode (line 335) | public function getStatusCode() {
    method setCharset (line 342) | public function setCharset($charset) {
    method getCharset (line 349) | public function getCharset() {
    method getHeaders (line 356) | public function getHeaders() {
    method ensureIEOverSSLCompatibility (line 365) | protected function ensureIEOverSSLCompatibility(Request $request) {
    method setDate (line 377) | public function setDate(\DateTime $date) {
    method pageFooter (line 393) | protected static function pageFooter() {

FILE: src/Http/ResponseInterface.php
  type ResponseInterface (line 13) | interface ResponseInterface {
    method create (line 31) | public static function create($content = '', $status = 200, $headers =...
    method prepare (line 43) | public function prepare(RequestInterface $request);
    method setContent (line 54) | public function setContent($content);
    method getContent (line 61) | public function getContent();
    method setProtocolVersion (line 68) | public function setProtocolVersion($version);
    method getProtocolVersion (line 75) | public function getProtocolVersion();
    method send (line 80) | public function send();
    method setStatusCode (line 95) | public function setStatusCode($code, $text = NULL);
    method getStatusCode (line 102) | public function getStatusCode();
    method setCharset (line 109) | public function setCharset($charset);
    method getCharset (line 116) | public function getCharset();
    method getHeaders (line 123) | public function getHeaders();
    method setDate (line 131) | public function setDate(\DateTime $date);

FILE: src/Plugin/AuthenticationPluginManager.php
  class AuthenticationPluginManager (line 18) | class AuthenticationPluginManager extends DefaultPluginManager {
    method __construct (line 43) | public function __construct(\Traversable $namespaces, \DrupalCacheInte...
    method create (line 60) | public static function create($bin = 'cache', $avoid_singleton = FALSE) {

FILE: src/Plugin/ConfigurablePluginTrait.php
  type ConfigurablePluginTrait (line 10) | trait ConfigurablePluginTrait {
    method getConfiguration (line 22) | public function getConfiguration() {
    method setConfiguration (line 32) | public function setConfiguration(array $configuration) {
    method defaultConfiguration (line 39) | public function defaultConfiguration() {
    method calculateDependencies (line 46) | public function calculateDependencies() {

FILE: src/Plugin/FormatterPluginManager.php
  class FormatterPluginManager (line 13) | class FormatterPluginManager extends DefaultPluginManager {
    method __construct (line 24) | public function __construct(\Traversable $namespaces, \DrupalCacheInte...
    method create (line 39) | public static function create($bin = 'cache') {

FILE: src/Plugin/RateLimitPluginManager.php
  class RateLimitPluginManager (line 13) | class RateLimitPluginManager extends DefaultPluginManager {
    method __construct (line 24) | public function __construct(\Traversable $namespaces, \DrupalCacheInte...
    method create (line 39) | public static function create($bin = 'cache') {

FILE: src/Plugin/ResourcePluginManager.php
  class ResourcePluginManager (line 15) | class ResourcePluginManager extends DefaultPluginManager {
    method __construct (line 35) | public function __construct(\Traversable $namespaces, \DrupalCacheInte...
    method create (line 53) | public static function create($bin = 'cache', RequestInterface $reques...
    method createInstance (line 63) | public function createInstance($plugin_id, array $configuration = arra...

FILE: src/Plugin/SemiSingletonTrait.php
  type SemiSingletonTrait (line 15) | trait SemiSingletonTrait {
    method semiSingletonInstance (line 35) | protected static function semiSingletonInstance(callable $factory, arr...

FILE: src/Plugin/authentication/Authentication.php
  class Authentication (line 15) | abstract class Authentication extends PluginBase implements Configurable...
    method applies (line 34) | public function applies(RequestInterface $request) {
    method getName (line 42) | public function getName() {

FILE: src/Plugin/authentication/AuthenticationInterface.php
  type AuthenticationInterface (line 13) | interface AuthenticationInterface extends PluginInspectionInterface {
    method authenticate (line 24) | public function authenticate(RequestInterface $request);
    method applies (line 37) | public function applies(RequestInterface $request);
    method getName (line 45) | public function getName();

FILE: src/Plugin/authentication/BasicAuthentication.php
  class BasicAuthentication (line 24) | class BasicAuthentication extends Authentication {
    method applies (line 29) | public function applies(RequestInterface $request) {
    method authenticate (line 46) | public function authenticate(RequestInterface $request) {

FILE: src/Plugin/authentication/CookieAuthentication.php
  class CookieAuthentication (line 24) | class CookieAuthentication extends Authentication {
    method authenticate (line 29) | public function authenticate(RequestInterface $request) {
    method isCli (line 66) | protected function isCli(RequestInterface $request) {

FILE: src/Plugin/authentication/OAuth2ServerAuthentication.php
  class OAuth2ServerAuthentication (line 20) | class OAuth2ServerAuthentication extends Authentication {
    method __construct (line 29) | public function __construct(array $configuration, $plugin_id, $plugin_...
    method applies (line 37) | public function applies(RequestInterface $request) {
    method authenticate (line 44) | public function authenticate(RequestInterface $request) {
    method getOAuth2Info (line 71) | protected function getOAuth2Info(RequestInterface $request) {
    method getResourcePluginIdFromRequest (line 96) | protected function getResourcePluginIdFromRequest() {

FILE: src/Plugin/formatter/Formatter.php
  class Formatter (line 25) | abstract class Formatter extends PluginBase implements FormatterInterface {
    method __construct (line 39) | public function __construct(array $configuration, $plugin_id, $plugin_...
    method format (line 46) | public function format(array $data) {
    method getContentTypeHeader (line 53) | public function getContentTypeHeader() {
    method getResource (line 61) | public function getResource() {
    method setResource (line 78) | public function setResource(ResourceInterface $resource) {
    method parseBody (line 88) | public function parseBody($body) {
    method isIterable (line 101) | protected static function isIterable($input) {
    method isCacheEnabled (line 114) | protected function isCacheEnabled($data) {
    method getCachedData (line 135) | protected function getCachedData($data) {
    method getCacheHash (line 151) | protected function getCacheHash($data) {
    method setCachedData (line 169) | protected function setCachedData($data, $output, array $parent_hashes ...
    method createCacheController (line 217) | protected function createCacheController($data) {
    method cacheFragments (line 245) | protected static function cacheFragments($data) {
    method limitFields (line 264) | protected function limitFields($output, $allowed_fields = NULL) {
    method unprefixInputOptions (line 302) | protected static function unprefixInputOptions($allowed_fields, $prefi...
    method calculateItemsPerPage (line 327) | protected function calculateItemsPerPage(ResourceInterface $resource) {

FILE: src/Plugin/formatter/FormatterHalJson.php
  class FormatterHalJson (line 30) | class FormatterHalJson extends Formatter implements FormatterInterface {
    method prepare (line 44) | public function prepare(array $data) {
    method addHateoas (line 107) | protected function addHateoas(array &$data) {
    method extractFieldValues (line 176) | protected function extractFieldValues($data, array $parents = array(),...
    method render (line 233) | public function render(array $structured_data) {
    method getContentTypeHeader (line 240) | public function getContentTypeHeader() {
    method withCurie (line 253) | protected function withCurie($property_name) {
    method getCurie (line 266) | protected function getCurie() {

FILE: src/Plugin/formatter/FormatterInterface.php
  type FormatterInterface (line 16) | interface FormatterInterface extends PluginInspectionInterface, Configur...
    method prepare (line 27) | public function prepare(array $data);
    method render (line 39) | public function render(array $structured_data);
    method format (line 53) | public function format(array $data);
    method getContentTypeHeader (line 61) | public function getContentTypeHeader();
    method getResource (line 69) | public function getResource();
    method setResource (line 77) | public function setResource(ResourceInterface $resource);
    method parseBody (line 91) | public function parseBody($body);

FILE: src/Plugin/formatter/FormatterJson.php
  class FormatterJson (line 27) | class FormatterJson extends Formatter implements FormatterInterface {
    method prepare (line 39) | public function prepare(array $data) {
    method extractFieldValues (line 91) | protected function extractFieldValues($data, array $parents = array(),...
    method addHateoas (line 149) | protected function addHateoas(array &$data) {
    method render (line 195) | public function render(array $structured_data) {
    method getContentTypeHeader (line 202) | public function getContentTypeHeader() {
    method parseBody (line 209) | public function parseBody($body) {

FILE: src/Plugin/formatter/FormatterJsonApi.php
  class FormatterJsonApi (line 34) | class FormatterJsonApi extends Formatter implements FormatterInterface {
    method prepare (line 46) | public function prepare(array $data) {
    method extractFieldValues (line 106) | protected function extractFieldValues($data, array $parents = array(),...
    method addHateoas (line 182) | protected function addHateoas(array &$data, ResourceInterface $resourc...
    method render (line 240) | public function render(array $structured_data) {
    method getContentTypeHeader (line 247) | public function getContentTypeHeader() {
    method getRequest (line 257) | protected function getRequest() {
    method renormalize (line 285) | protected function renormalize(array $output, array &$included, $allow...
    method populateIncludes (line 379) | protected function populateIncludes($output, $included) {
    method embedField (line 424) | protected function embedField(ResourceFieldInterface $resource_field, ...
    method needsIncluding (line 527) | protected function needsIncluding(ResourceFieldResourceInterface $reso...
    method buildIncludePath (line 548) | protected function buildIncludePath(array $parents, $public_field_name...
    method populateCachePlaceholder (line 574) | protected function populateCachePlaceholder(array $field_item, $includ...
    method parseBody (line 625) | public function parseBody($body) {
    method restructureItem (line 659) | protected static function restructureItem(array $item, array $included) {
    method retrieveIncludedItem (line 727) | protected static function retrieveIncludedItem($type, $id, array $incl...

FILE: src/Plugin/formatter/FormatterSingleJson.php
  class FormatterSingleJson (line 22) | class FormatterSingleJson extends FormatterJson {
    method prepare (line 34) | public function prepare(array $data) {

FILE: src/Plugin/rate_limit/RateLimit.php
  class RateLimit (line 14) | abstract class RateLimit extends PluginBase implements RateLimitInterface {
    method __construct (line 40) | public function __construct(array $configuration, $plugin_id, $plugin_...
    method setLimit (line 55) | public function setLimit($limits) {
    method getLimit (line 62) | public function getLimit($account = NULL) {
    method setPeriod (line 89) | public function setPeriod(\DateInterval $period) {
    method getPeriod (line 96) | public function getPeriod() {
    method generateIdentifier (line 103) | public function generateIdentifier($account = NULL) {
    method loadRateLimitEntity (line 117) | public function loadRateLimitEntity($account = NULL) {

FILE: src/Plugin/rate_limit/RateLimitGlobal.php
  class RateLimitGlobal (line 22) | class RateLimitGlobal extends RateLimit {
    method __construct (line 27) | public function __construct(array $configuration, $plugin_id, $plugin_...
    method generateIdentifier (line 39) | public function generateIdentifier($account = NULL) {
    method getLimit (line 51) | public function getLimit($account = NULL) {
    method isRequestedEvent (line 60) | public function isRequestedEvent(RequestInterface $request) {

FILE: src/Plugin/rate_limit/RateLimitInterface.php
  type RateLimitInterface (line 13) | interface RateLimitInterface extends PluginInspectionInterface {
    method isRequestedEvent (line 24) | public function isRequestedEvent(RequestInterface $request);
    method setLimit (line 33) | public function setLimit($limits);
    method getLimit (line 44) | public function getLimit($account = NULL);
    method setPeriod (line 51) | public function setPeriod(\DateInterval $period);
    method getPeriod (line 59) | public function getPeriod();
    method generateIdentifier (line 70) | public function generateIdentifier($account = NULL);
    method loadRateLimitEntity (line 81) | public function loadRateLimitEntity($account = NULL);

FILE: src/Plugin/rate_limit/RateLimitRequest.php
  class RateLimitRequest (line 21) | class RateLimitRequest extends RateLimit {
    method isRequestedEvent (line 26) | public function isRequestedEvent(RequestInterface $request) {

FILE: src/Plugin/resource/AuthenticatedResource.php
  class AuthenticatedResource (line 15) | class AuthenticatedResource extends PluginBase implements AuthenticatedR...
    method setAuthenticationManager (line 34) | public function setAuthenticationManager(AuthenticationManager $authen...
    method getAuthenticationManager (line 41) | public function getAuthenticationManager() {
    method dataProviderFactory (line 53) | public function dataProviderFactory() {
    method getAccount (line 62) | public function getAccount($cache = TRUE) {
    method getRequest (line 74) | public function getRequest() {
    method getPath (line 81) | public function getPath() {
    method getFieldDefinitions (line 88) | public function getFieldDefinitions() {
    method getDataProvider (line 95) | public function getDataProvider() {
    method __construct (line 107) | public function __construct(ResourceInterface $subject, Authentication...
    method process (line 115) | public function process() {
    method controllersInfo (line 122) | public function controllersInfo() {
    method getControllers (line 129) | public function getControllers() {
    method getResourceName (line 136) | public function getResourceName() {
    method index (line 143) | public function index($path) {
    method view (line 150) | public function view($path) {
    method create (line 157) | public function create($path) {
    method update (line 164) | public function update($path) {
    method replace (line 171) | public function replace($path) {
    method remove (line 178) | public function remove($path) {
    method getVersion (line 185) | public function getVersion() {

FILE: src/Plugin/resource/AuthenticatedResourceInterface.php
  type AuthenticatedResourceInterface (line 13) | interface AuthenticatedResourceInterface extends PluginInspectionInterfa...
    method setAuthenticationManager (line 21) | public function setAuthenticationManager(AuthenticationManager $authen...
    method getAuthenticationManager (line 29) | public function getAuthenticationManager();

FILE: src/Plugin/resource/CrudInterface.php
  type CrudInterface (line 10) | interface CrudInterface {
    method index (line 18) | public function index();
    method count (line 26) | public function count();
    method create (line 37) | public function create($object);
    method view (line 48) | public function view($identifier);
    method viewMultiple (line 59) | public function viewMultiple(array $identifiers);
    method update (line 76) | public function update($identifier, $object, $replace = FALSE);
    method remove (line 84) | public function remove($identifier);

FILE: src/Plugin/resource/CsrfToken.php
  class CsrfToken (line 32) | class CsrfToken extends Resource implements ResourceInterface {
    method publicFields (line 37) | protected function publicFields() {
    method getCsrfToken (line 51) | public static function getCsrfToken() {
    method index (line 58) | public function index($path) {

FILE: src/Plugin/resource/DataInterpreter/ArrayWrapper.php
  class ArrayWrapper (line 10) | class ArrayWrapper implements ArrayWrapperInterface {
    method __construct (line 25) | public function __construct(array $data) {
    method get (line 32) | public function get($key) {

FILE: src/Plugin/resource/DataInterpreter/ArrayWrapperInterface.php
  type ArrayWrapperInterface (line 10) | interface ArrayWrapperInterface {
    method get (line 21) | public function get($key);

FILE: src/Plugin/resource/DataInterpreter/DataInterpreterArray.php
  class DataInterpreterArray (line 10) | class DataInterpreterArray extends DataInterpreterBase implements DataIn...

FILE: src/Plugin/resource/DataInterpreter/DataInterpreterBase.php
  class DataInterpreterBase (line 10) | abstract class DataInterpreterBase implements DataInterpreterInterface {
    method __construct (line 34) | public function __construct($account, $wrapper) {
    method getAccount (line 42) | public function getAccount() {
    method getWrapper (line 49) | public function getWrapper() {

FILE: src/Plugin/resource/DataInterpreter/DataInterpreterEMW.php
  class DataInterpreterEMW (line 10) | class DataInterpreterEMW extends DataInterpreterBase implements DataInte...
    method getWrapper (line 18) | public function getWrapper() {

FILE: src/Plugin/resource/DataInterpreter/DataInterpreterInterface.php
  type DataInterpreterInterface (line 10) | interface DataInterpreterInterface {
    method getAccount (line 18) | public function getAccount();
    method getWrapper (line 29) | public function getWrapper();

FILE: src/Plugin/resource/DataInterpreter/DataInterpreterPlug.php
  class DataInterpreterPlug (line 10) | class DataInterpreterPlug extends DataInterpreterBase implements DataInt...

FILE: src/Plugin/resource/DataInterpreter/PluginWrapper.php
  class PluginWrapper (line 13) | class PluginWrapper implements PluginWrapperInterface {
    method __construct (line 42) | public function __construct(PluginInspectionInterface $plugin) {
    method get (line 54) | public function get($key) {

FILE: src/Plugin/resource/DataInterpreter/PluginWrapperInterface.php
  type PluginWrapperInterface (line 11) | interface PluginWrapperInterface {
    method get (line 22) | public function get($key);

FILE: src/Plugin/resource/DataProvider/CacheDecoratedDataProvider.php
  class CacheDecoratedDataProvider (line 23) | class CacheDecoratedDataProvider implements CacheDecoratedDataProviderIn...
    method __construct (line 47) | public function __construct(DataProviderInterface $subject, \DrupalCac...
    method isNestedField (line 55) | public static function isNestedField($field_name) {
    method processFilterInput (line 62) | public static function processFilterInput($filter, $public_field) {
    method discover (line 69) | public function discover($path = NULL) {
    method getRange (line 76) | public function getRange() {
    method setRange (line 83) | public function setRange($range) {
    method getAccount (line 90) | public function getAccount() {
    method setAccount (line 97) | public function setAccount($account) {
    method getRequest (line 104) | public function getRequest() {
    method setRequest (line 111) | public function setRequest(RequestInterface $request) {
    method getLangCode (line 118) | public function getLangCode() {
    method setLangCode (line 125) | public function setLangCode($langcode) {
    method getOptions (line 132) | public function getOptions() {
    method addOptions (line 139) | public function addOptions(array $options) {
    method getCacheFragments (line 146) | public function getCacheFragments($identifier) {
    method index (line 153) | public function index() {
    method getIndexIds (line 163) | public function getIndexIds() {
    method count (line 170) | public function count() {
    method create (line 177) | public function create($object) {
    method view (line 184) | public function view($identifier) {
    method viewMultiple (line 197) | public function viewMultiple(array $identifiers) {
    method update (line 217) | public function update($identifier, $object, $replace = TRUE) {
    method remove (line 225) | public function remove($identifier) {
    method methodAccess (line 233) | public function methodAccess(ResourceFieldInterface $resource_field) {
    method canonicalPath (line 240) | public function canonicalPath($path) {
    method setOptions (line 247) | public function setOptions(array $options) {
    method setResourcePath (line 254) | public function setResourcePath($resource_path) {
    method getResourcePath (line 261) | public function getResourcePath() {
    method getMetadata (line 268) | public function getMetadata() {
    method clearRenderedCache (line 278) | protected function clearRenderedCache(ArrayCollection $cache_fragments) {
    method isInstanceOf (line 293) | public function isInstanceOf($class) {

FILE: src/Plugin/resource/DataProvider/CacheDecoratedDataProviderInterface.php
  type CacheDecoratedDataProviderInterface (line 14) | interface CacheDecoratedDataProviderInterface extends DataProviderInterf...

FILE: src/Plugin/resource/DataProvider/DataProvider.php
  class DataProvider (line 21) | abstract class DataProvider implements DataProviderInterface {
    method processFilterInput (line 89) | public static function processFilterInput($filter, $public_field) {
    method __construct (line 160) | public function __construct(RequestInterface $request, ResourceFieldCo...
    method getRange (line 178) | public function getRange() {
    method setRange (line 185) | public function setRange($range) {
    method getAccount (line 192) | public function getAccount() {
    method setAccount (line 199) | public function setAccount($account) {
    method getRequest (line 206) | public function getRequest() {
    method setRequest (line 213) | public function setRequest(RequestInterface $request) {
    method getLangCode (line 220) | public function getLangCode() {
    method setLangCode (line 227) | public function setLangCode($langcode) {
    method getOptions (line 234) | public function getOptions() {
    method setOptions (line 241) | public function setOptions(array $options) {
    method addOptions (line 248) | public function addOptions(array $options) {
    method getCacheFragments (line 255) | public function getCacheFragments($identifier) {
    method index (line 280) | public function index() {
    method discover (line 291) | public function discover($path = NULL) {
    method canonicalPath (line 319) | public function canonicalPath($path) {
    method methodAccess (line 327) | public function methodAccess(ResourceFieldInterface $resource_field) {
    method parseRequestForListSort (line 340) | protected function parseRequestForListSort() {
    method parseRequestForListFilter (line 377) | protected function parseRequestForListFilter() {
    method parseRequestForListPagination (line 418) | protected function parseRequestForListPagination() {
    method addExtraInfoToQuery (line 447) | protected function addExtraInfoToQuery($query) {
    method isValidOperatorsForFilter (line 461) | protected static function isValidOperatorsForFilter(array $operators) {
    method isValidConjunctionForFilter (line 493) | protected static function isValidConjunctionForFilter($conjunction) {
    method getLanguage (line 514) | protected static function getLanguage() {
    method setHttpHeader (line 527) | protected function setHttpHeader($name, $value) {
    method setResourcePath (line 537) | public function setResourcePath($resource_path) {
    method getResourcePath (line 544) | public function getResourcePath() {
    method isNestedField (line 551) | public static function isNestedField($field_name) {
    method getMetadata (line 558) | public function getMetadata() {
    method initResourceFieldCollection (line 573) | protected function initResourceFieldCollection($identifier) {
    method initDataInterpreter (line 592) | abstract protected function initDataInterpreter($identifier);

FILE: src/Plugin/resource/DataProvider/DataProviderDbQuery.php
  class DataProviderDbQuery (line 23) | class DataProviderDbQuery extends DataProvider implements DataProviderDb...
    method __construct (line 54) | public function __construct(RequestInterface $request, ResourceFieldCo...
    method getTableName (line 75) | public function getTableName() {
    method setTableName (line 82) | public function setTableName($table_name) {
    method getPrimary (line 89) | public function getPrimary() {
    method setPrimary (line 96) | public function setPrimary($primary) {
    method getCacheFragments (line 103) | public function getCacheFragments($identifier) {
    method count (line 130) | public function count() {
    method isPrimaryField (line 141) | public function isPrimaryField($field_name) {
    method getIdColumn (line 152) | protected function getIdColumn() {
    method create (line 159) | public function create($object) {
    method view (line 209) | public function view($identifier) {
    method mapDbRowToPublicFields (line 226) | protected function mapDbRowToPublicFields($row) {
    method addExtraInfoToQuery (line 248) | protected function addExtraInfoToQuery($query) {
    method viewMultiple (line 257) | public function viewMultiple(array $identifiers) {
    method getQueryForList (line 277) | protected function getQueryForList() {
    method update (line 289) | public function update($identifier, $object, $replace = FALSE) {
    method remove (line 340) | public function remove($identifier) {
    method getIndexIds (line 354) | public function getIndexIds() {
    method index (line 370) | public function index() {
    method defaultSortInfo (line 388) | protected function defaultSortInfo() {
    method queryForListSort (line 410) | protected function queryForListSort(\SelectQuery $query) {
    method queryForListFilter (line 432) | protected function queryForListFilter(\SelectQuery $query) {
    method queryForListPagination (line 464) | protected function queryForListPagination(\SelectQuery $query) {
    method getQuery (line 475) | protected function getQuery() {
    method getColumnFromIds (line 493) | protected function getColumnFromIds(array $identifiers, $column = 0) {
    method initDataInterpreter (line 508) | protected function initDataInterpreter($identifier) {

FILE: src/Plugin/resource/DataProvider/DataProviderDbQueryInterface.php
  type DataProviderDbQueryInterface (line 10) | interface DataProviderDbQueryInterface extends DataProviderInterface {
    method getTableName (line 18) | public function getTableName();
    method setTableName (line 26) | public function setTableName($table_name);
    method getPrimary (line 34) | public function getPrimary();
    method setPrimary (line 42) | public function setPrimary($primary);
    method isPrimaryField (line 53) | public function isPrimaryField($field_name);

FILE: src/Plugin/resource/DataProvider/DataProviderDecorator.php
  class DataProviderDecorator (line 13) | abstract class DataProviderDecorator implements DataProviderInterface {
    method __construct (line 28) | public function __construct(DataProviderInterface $decorated) {
    method getRange (line 35) | public function getRange() {
    method setRange (line 42) | public function setRange($range) {
    method getAccount (line 49) | public function getAccount() {
    method setAccount (line 56) | public function setAccount($account) {
    method getRequest (line 63) | public function getRequest() {
    method setRequest (line 70) | public function setRequest(RequestInterface $request) {
    method getLangCode (line 77) | public function getLangCode() {
    method setLangCode (line 84) | public function setLangCode($langcode) {
    method getOptions (line 91) | public function getOptions() {
    method addOptions (line 98) | public function addOptions(array $options) {
    method getCacheFragments (line 105) | public function getCacheFragments($identifier) {
    method canonicalPath (line 112) | public function canonicalPath($path) {
    method methodAccess (line 119) | public function methodAccess(ResourceFieldInterface $resource_field) {
    method setOptions (line 126) | public function setOptions(array $options) {
    method getIndexIds (line 133) | public function getIndexIds() {
    method index (line 140) | public function index() {
    method count (line 147) | public function count() {
    method create (line 154) | public function create($object) {
    method view (line 161) | public function view($identifier) {
    method viewMultiple (line 168) | public function viewMultiple(array $identifiers) {
    method update (line 175) | public function update($identifier, $object, $replace = FALSE) {
    method remove (line 182) | public function remove($identifier) {
    method discover (line 189) | public function discover($path = NULL) {
    method isNestedField (line 196) | public static function isNestedField($field_name) {
    method processFilterInput (line 203) | public static function processFilterInput($filter, $public_field) {
    method setResourcePath (line 210) | public function setResourcePath($resource_path) {
    method getResourcePath (line 217) | public function getResourcePath() {
    method getMetadata (line 224) | public function getMetadata() {

FILE: src/Plugin/resource/DataProvider/DataProviderEntity.php
  class DataProviderEntity (line 41) | class DataProviderEntity extends DataProvider implements DataProviderEnt...
    method __construct (line 87) | public function __construct(RequestInterface $request, ResourceFieldCo...
    method getCacheFragments (line 124) | public function getCacheFragments($identifier) {
    method defaultSortInfo (line 154) | protected function defaultSortInfo() {
    method getIndexIds (line 161) | public function getIndexIds() {
    method count (line 189) | public function count() {
    method create (line 197) | public function create($object) {
    method view (line 234) | public function view($identifier) {
    method viewMultiple (line 273) | public function viewMultiple(array $identifiers) {
    method update (line 293) | public function update($identifier, $object, $replace = FALSE) {
    method remove (line 323) | public function remove($identifier) {
    method canonicalPath (line 338) | public function canonicalPath($path) {
    method entityPreSave (line 347) | public function entityPreSave(\EntityDrupalWrapper $wrapper) {}
    method entityValidate (line 352) | public function entityValidate(\EntityDrupalWrapper $wrapper) {
    method getEntityIdByFieldId (line 433) | protected function getEntityIdByFieldId($id) {
    method getEntityFieldQuery (line 482) | protected function getEntityFieldQuery() {
    method EFQObject (line 496) | public function EFQObject() {
    method getEntityInfo (line 512) | protected function getEntityInfo($type = NULL) {
    method getQueryForList (line 522) | protected function getQueryForList() {
    method getQueryCount (line 552) | protected function getQueryCount() {
    method addExtraInfoToQuery (line 581) | protected function addExtraInfoToQuery($query) {
    method queryForListSort (line 603) | protected function queryForListSort(\EntityFieldQuery $query) {
    method queryForListFilter (line 656) | protected function queryForListFilter(\EntityFieldQuery $query) {
    method alterFilterQuery (line 733) | protected function alterFilterQuery(array $filter, \EntityFieldQuery $...
    method alterSortQuery (line 765) | protected function alterSortQuery(array $sort, \EntityFieldQuery $quer...
    method isMultipleValuOperator (line 787) | protected static function isMultipleValuOperator($operator_name) {
    method validateFilters (line 800) | protected function validateFilters(array $filters) {
    method queryForListPagination (line 830) | protected function queryForListPagination(\EntityFieldQuery $query) {
    method isValidOperatorsForFilter (line 838) | protected static function isValidOperatorsForFilter(array $operators) {
    method isValidConjunctionForFilter (line 865) | protected static function isValidConjunctionForFilter($conjunction) {
    method getColumnFromProperty (line 893) | protected function getColumnFromProperty($property_name) {
    method isValidEntity (line 912) | protected function isValidEntity($op, $entity_id) {
    method checkEntityAccess (line 967) | protected function checkEntityAccess($op, $entity_type, $entity) {
    method setPropertyValues (line 987) | protected function setPropertyValues(\EntityDrupalWrapper $wrapper, $o...
    method validateBody (line 1079) | protected function validateBody($body) {
    method checkPropertyAccess (line 1099) | protected static function checkPropertyAccess(ResourceFieldInterface $...
    method getReferencedId (line 1117) | protected function getReferencedId($value, ResourceFieldInterface $res...
    method getReferencedIds (line 1218) | protected function getReferencedIds(array $values, ResourceFieldInterf...
    method addNestedFilter (line 1238) | protected function addNestedFilter(array $filter, \EntityFieldQuery $q...
    method getFieldsInfoFromPublicName (line 1260) | protected function getFieldsInfoFromPublicName($name) {
    method getFieldsFromPublicNameItem (line 1314) | protected function getFieldsFromPublicNameItem(ResourceFieldResourceIn...
    method initDataInterpreter (line 1337) | protected function initDataInterpreter($identifier) {

FILE: src/Plugin/resource/DataProvider/DataProviderEntityDecorator.php
  class DataProviderEntityDecorator (line 12) | abstract class DataProviderEntityDecorator extends DataProviderDecorator...
    method __construct (line 27) | public function __construct(DataProviderEntityInterface $decorated) {
    method entityPreSave (line 39) | public function entityPreSave(\EntityDrupalWrapper $wrapper) {
    method entityValidate (line 51) | public function entityValidate(\EntityDrupalWrapper $wrapper) {
    method EFQObject (line 61) | public function EFQObject() {

FILE: src/Plugin/resource/DataProvider/DataProviderEntityInterface.php
  type DataProviderEntityInterface (line 12) | interface DataProviderEntityInterface extends DataProviderInterface {
    method entityPreSave (line 20) | public function entityPreSave(\EntityDrupalWrapper $wrapper);
    method entityValidate (line 30) | public function entityValidate(\EntityDrupalWrapper $wrapper);
    method EFQObject (line 38) | public function EFQObject();

FILE: src/Plugin/resource/DataProvider/DataProviderFile.php
  class DataProviderFile (line 21) | class DataProviderFile extends DataProviderEntity implements DataProvide...
    method __construct (line 26) | public function __construct(RequestInterface $request, ResourceFieldCo...
    method create (line 44) | public function create($object) {
    method fileSaveUpload (line 103) | protected function fileSaveUpload($source, array $files) {
    method checkUploadErrors (line 275) | protected function checkUploadErrors($source, array $files) {
    method isUploadedFile (line 316) | protected static function isUploadedFile($filename) {
    method moveUploadedFile (line 331) | protected static function moveUploadedFile($filename, $uri) {

FILE: src/Plugin/resource/DataProvider/DataProviderInterface.php
  type DataProviderInterface (line 14) | interface DataProviderInterface extends CrudInterface {
    method discover (line 25) | public function discover($path = NULL);
    method isNestedField (line 36) | public static function isNestedField($field_name);
    method processFilterInput (line 51) | public static function processFilterInput($filter, $public_field);
    method getRange (line 59) | public function getRange();
    method setRange (line 67) | public function setRange($range);
    method getAccount (line 75) | public function getAccount();
    method setAccount (line 83) | public function setAccount($account);
    method getRequest (line 91) | public function getRequest();
    method setRequest (line 99) | public function setRequest(RequestInterface $request);
    method getLangCode (line 107) | public function getLangCode();
    method setLangCode (line 115) | public function setLangCode($langcode);
    method getOptions (line 123) | public function getOptions();
    method addOptions (line 131) | public function addOptions(array $options);
    method getCacheFragments (line 139) | public function getCacheFragments($identifier);
    method canonicalPath (line 150) | public function canonicalPath($path);
    method methodAccess (line 161) | public function methodAccess(ResourceFieldInterface $resource_field);
    method setOptions (line 169) | public function setOptions(array $options);
    method getIndexIds (line 177) | public function getIndexIds();
    method setResourcePath (line 185) | public function setResourcePath($resource_path);
    method getResourcePath (line 193) | public function getResourcePath();
    method getMetadata (line 205) | public function getMetadata();

FILE: src/Plugin/resource/DataProvider/DataProviderNode.php
  class DataProviderNode (line 15) | class DataProviderNode extends DataProviderEntity implements DataProvide...
    method getQueryForList (line 22) | public function getQueryForList() {
    method getQueryCount (line 33) | public function getQueryCount() {
    method entityPreSave (line 42) | public function entityPreSave(\EntityDrupalWrapper $wrapper) {

FILE: src/Plugin/resource/DataProvider/DataProviderNull.php
  class DataProviderNull (line 10) | class DataProviderNull extends DataProvider implements DataProviderInter...
    method count (line 15) | public function count() {
    method create (line 22) | public function create($object) {
    method view (line 30) | public function view($identifier) {
    method viewMultiple (line 37) | public function viewMultiple(array $identifiers) {
    method update (line 44) | public function update($identifier, $object, $replace = FALSE) {
    method remove (line 51) | public function remove($identifier) {}
    method getIndexIds (line 56) | public function getIndexIds() {
    method initDataInterpreter (line 63) | protected function initDataInterpreter($identifier) {

FILE: src/Plugin/resource/DataProvider/DataProviderPlug.php
  class DataProviderPlug (line 26) | class DataProviderPlug extends DataProvider implements DataProviderInter...
    method __construct (line 31) | public function __construct(RequestInterface $request, ResourceFieldCo...
    method count (line 45) | public function count() {
    method create (line 52) | public function create($object) {
    method view (line 59) | public function view($identifier) {
    method viewMultiple (line 87) | public function viewMultiple(array $identifiers) {
    method update (line 105) | public function update($identifier, $object, $replace = FALSE) {
    method remove (line 117) | public function remove($identifier) {
    method getIndexIds (line 127) | public function getIndexIds() {
    method applyFilters (line 150) | protected function applyFilters(array $plugins) {
    method applySort (line 200) | protected function applySort(array $plugins) {
    method initDataInterpreter (line 225) | protected function initDataInterpreter($identifier) {
    method getCacheFragments (line 247) | public function getCacheFragments($identifier) {

FILE: src/Plugin/resource/DataProvider/DataProviderResource.php
  class DataProviderResource (line 23) | class DataProviderResource extends DataProvider implements DataProviderR...
    method __construct (line 59) | public function __construct(RequestInterface $request, ResourceFieldCo...
    method init (line 69) | public static function init(RequestInterface $request, $resource_name,...
    method index (line 83) | public function index() {
    method getIndexIds (line 90) | public function getIndexIds() {
    method create (line 97) | public function create($object) {
    method view (line 104) | public function view($identifier) {
    method viewMultiple (line 111) | public function viewMultiple(array $identifiers) {
    method update (line 118) | public function update($identifier, $object, $replace = FALSE) {
    method remove (line 125) | public function remove($identifier) {
    method merge (line 132) | public function merge($identifier, $object) {
    method count (line 143) | public function count() {
    method initDataInterpreter (line 150) | protected function initDataInterpreter($identifier) {

FILE: src/Plugin/resource/DataProvider/DataProviderResourceInterface.php
  type DataProviderResourceInterface (line 12) | interface DataProviderResourceInterface extends DataProviderInterface {
    method init (line 27) | public static function init(RequestInterface $request, $resource_name,...
    method merge (line 40) | public function merge($identifier, $object);

FILE: src/Plugin/resource/DataProvider/DataProviderTaxonomyTerm.php
  class DataProviderTaxonomyTerm (line 10) | class DataProviderTaxonomyTerm extends DataProviderEntity implements Dat...
    method setPropertyValues (line 20) | protected function setPropertyValues(\EntityDrupalWrapper $wrapper, $o...

FILE: src/Plugin/resource/Decorators/CacheDecoratedResource.php
  class CacheDecoratedResource (line 18) | class CacheDecoratedResource extends ResourceDecoratorBase implements Ca...
    method __construct (line 47) | public function __construct(ResourceInterface $subject, \DrupalCacheIn...
    method getCacheController (line 58) | public function getCacheController() {
    method newCacheObject (line 75) | protected function newCacheObject() {
    method dataProviderFactory (line 103) | public function dataProviderFactory() {
    method getPath (line 127) | public function getPath() {
    method setPath (line 134) | public function setPath($path) {
    method getFieldDefinitions (line 141) | public function getFieldDefinitions() {
    method getDataProvider (line 148) | public function getDataProvider() {
    method setDataProvider (line 159) | public function setDataProvider(DataProviderInterface $data_provider =...
    method process (line 166) | public function process() {
    method view (line 175) | public function view($path) {
    method index (line 200) | public function index($path) {
    method update (line 208) | public function update($path) {
    method replace (line 217) | public function replace($path) {
    method remove (line 226) | public function remove($path) {
    method defaultCacheInfo (line 237) | protected function defaultCacheInfo() {
    method getResourceMachineName (line 254) | public function getResourceMachineName() {
    method getPluginDefinition (line 264) | public function getPluginDefinition() {
    method enable (line 271) | public function enable() {
    method disable (line 278) | public function disable() {
    method isEnabled (line 285) | public function isEnabled() {
    method hasSimpleInvalidation (line 292) | public function hasSimpleInvalidation() {
    method invalidateResourceCache (line 305) | protected function invalidateResourceCache($id) {
    method serializeKeyValue (line 321) | public static function serializeKeyValue($key, $value) {

FILE: src/Plugin/resource/Decorators/CacheDecoratedResourceInterface.php
  type CacheDecoratedResourceInterface (line 11) | interface CacheDecoratedResourceInterface extends ResourceDecoratorInter...
    method serializeKeyValue (line 23) | public static function serializeKeyValue($key, $value);
    method getCacheController (line 32) | public function getCacheController();
    method hasSimpleInvalidation (line 40) | public function hasSimpleInvalidation();

FILE: src/Plugin/resource/Decorators/RateLimitDecoratedResource.php
  class RateLimitDecoratedResource (line 18) | class RateLimitDecoratedResource extends ResourceDecoratorBase implement...
    method __construct (line 35) | public function __construct(ResourceInterface $subject, RateLimitManag...
    method setRateLimitManager (line 57) | protected function setRateLimitManager(RateLimitManager $rate_limit_ma...
    method getRateLimitManager (line 67) | protected function getRateLimitManager() {
    method process (line 74) | public function process() {
    method setAccount (line 83) | public function setAccount($account) {

FILE: src/Plugin/resource/Decorators/ResourceDecoratorBase.php
  class ResourceDecoratorBase (line 25) | abstract class ResourceDecoratorBase extends PluginBase implements Resou...
    method getDecoratedResource (line 37) | public function getDecoratedResource() {
    method getPrimaryResource (line 44) | public function getPrimaryResource() {
    method dataProviderFactory (line 55) | public function dataProviderFactory() {
    method getAccount (line 62) | public function getAccount($cache = TRUE) {
    method setAccount (line 69) | public function setAccount($account) {
    method switchUserBack (line 77) | public function switchUserBack() {
    method discover (line 84) | public function discover($path = NULL) {
    method getRequest (line 91) | public function getRequest() {
    method setRequest (line 98) | public function setRequest(RequestInterface $request) {
    method getPath (line 107) | public function getPath() {
    method setPath (line 114) | public function setPath($path) {
    method getFieldDefinitions (line 121) | public function getFieldDefinitions() {
    method getDataProvider (line 128) | public function getDataProvider() {
    method setDataProvider (line 135) | public function setDataProvider(DataProviderInterface $data_provider =...
    method getResourceName (line 142) | public function getResourceName() {
    method process (line 149) | public function process() {
    method controllersInfo (line 156) | public function controllersInfo() {
    method getControllers (line 163) | public function getControllers() {
    method index (line 170) | public function index($path) {
    method view (line 177) | public function view($path) {
    method create (line 184) | public function create($path) {
    method update (line 191) | public function update($path) {
    method replace (line 198) | public function replace($path) {
    method remove (line 205) | public function remove($path) {
    method getVersion (line 212) | public function getVersion() {
    method versionedUrl (line 219) | public function versionedUrl($path = '', $options = array(), $version_...
    method getConfiguration (line 226) | public function getConfiguration() {
    method setConfiguration (line 233) | public function setConfiguration(array $configuration) {
    method defaultConfiguration (line 240) | public function defaultConfiguration() {
    method calculateDependencies (line 247) | public function calculateDependencies() {
    method access (line 254) | public function access() {
    method getControllerFromPath (line 261) | public function getControllerFromPath($path = NULL, ResourceInterface ...
    method getResourceMachineName (line 268) | public function getResourceMachineName() {
    method getPluginDefinition (line 278) | public function getPluginDefinition() {
    method setPluginDefinition (line 288) | public function setPluginDefinition(array $plugin_definition) {
    method enable (line 298) | public function enable() {
    method disable (line 305) | public function disable() {
    method isEnabled (line 312) | public function isEnabled() {
    method setFieldDefinitions (line 319) | public function setFieldDefinitions(ResourceFieldCollectionInterface $...
    method getUrl (line 326) | public function getUrl(array $options = array(), $keep_query = TRUE, R...
    method doGet (line 333) | public function doGet($path = '', array $query = array()) {
    method doPost (line 342) | public function doPost(array $parsed_body) {
    method doPatch (line 349) | public function doPatch($path, array $parsed_body) {
    method doPut (line 359) | public function doPut($path, array $parsed_body) {
    method doWrite (line 369) | private function doWrite($method, $path, array $parsed_body) {
    method doDelete (line 378) | public function doDelete($path) {
    method getPluginId (line 390) | public function getPluginId() {
    method isInstanceOf (line 404) | public function isInstanceOf($class) {
    method __call (line 433) | public function __call($name, $arguments) {

FILE: src/Plugin/resource/Decorators/ResourceDecoratorInterface.php
  type ResourceDecoratorInterface (line 13) | interface ResourceDecoratorInterface extends ResourceInterface {
    method getDecoratedResource (line 21) | public function getDecoratedResource();
    method getPrimaryResource (line 29) | public function getPrimaryResource();

FILE: src/Plugin/resource/Discovery.php
  class Discovery (line 33) | class Discovery extends Resource {
    method publicFields (line 38) | protected function publicFields() {
    method dataProviderClassName (line 67) | protected function dataProviderClassName() {
    method getSelf (line 80) | public function getSelf(DataInterpreterInterface $interpreter) {
    method controllersInfo (line 93) | public function controllersInfo() {
    method resourceManipulationAccess (line 125) | public function resourceManipulationAccess($path) {

FILE: src/Plugin/resource/Field/PublicFieldInfo/PublicFieldInfoBase.php
  class PublicFieldInfoBase (line 12) | class PublicFieldInfoBase implements PublicFieldInfoInterface {
    method __construct (line 63) | public function __construct($field_name, array $sections = array()) {
    method prepare (line 74) | public function prepare() {
    method addCategory (line 81) | public function addCategory($category_name, array $section_info) {
    method getSection (line 95) | public function getSection($section_name) {
    method addSectionDefaults (line 102) | public function addSectionDefaults($section_name, array $section_info) {
    method validate (line 121) | protected function validate($section_name, array $section_info) {
    method process (line 145) | protected function process($section_name, array $section_info) {
    method validateInfo (line 173) | protected function validateInfo(array $section_info) {
    method validateData (line 188) | protected function validateData(array $section_info) {
    method validateFormElement (line 203) | protected function validateFormElement(array $section_info) {

FILE: src/Plugin/resource/Field/PublicFieldInfo/PublicFieldInfoEntity.php
  class PublicFieldInfoEntity (line 10) | class PublicFieldInfoEntity extends PublicFieldInfoBase implements Publi...
    method __construct (line 47) | public function __construct($field_name, $property, $entity_type, $bun...
    method getFormSchemaAllowedValues (line 57) | public function getFormSchemaAllowedValues() {
    method getFormSchemaAllowedType (line 94) | public function getFormSchemaAllowedType() {
    method getEntityInfo (line 119) | protected function getEntityInfo($type = NULL) {
    method formSchemaHasAllowedValues (line 137) | protected static function formSchemaHasAllowedValues($field, $field_in...

FILE: src/Plugin/resource/Field/PublicFieldInfo/PublicFieldInfoEntityInterface.php
  type PublicFieldInfoEntityInterface (line 10) | interface PublicFieldInfoEntityInterface extends PublicFieldInfoInterface {
    method getFormSchemaAllowedValues (line 20) | public function getFormSchemaAllowedValues();
    method getFormSchemaAllowedType (line 30) | public function getFormSchemaAllowedType();

FILE: src/Plugin/resource/Field/PublicFieldInfo/PublicFieldInfoInterface.php
  type PublicFieldInfoInterface (line 10) | interface PublicFieldInfoInterface {
    method prepare (line 18) | public function prepare();
    method addCategory (line 29) | public function addCategory($category_name, array $section_info);
    method getSection (line 41) | public function getSection($section_name);
    method addSectionDefaults (line 52) | public function addSectionDefaults($section_name, array $section_info);

FILE: src/Plugin/resource/Field/PublicFieldInfo/PublicFieldInfoNull.php
  class PublicFieldInfoNull (line 10) | class PublicFieldInfoNull implements PublicFieldInfoInterface {
    method __construct (line 20) | public function __construct($field_name, array $sections = array()) {
    method prepare (line 27) | public function prepare() {
    method addCategory (line 34) | public function addCategory($category_name, array $section_info) {}
    method getSection (line 39) | public function getSection($section_name) {
    method addSectionDefaults (line 46) | public function addSectionDefaults($section_name, array $section_info) {}

FILE: src/Plugin/resource/Field/ResourceField.php
  class ResourceField (line 15) | class ResourceField extends ResourceFieldBase implements ResourceFieldIn...
    method __construct (line 25) | public function __construct(array $field, RequestInterface $request) {
    method create (line 46) | public static function create(array $field, RequestInterface $request ...
    method value (line 67) | public function value(DataInterpreterInterface $interpreter) {
    method set (line 77) | public function set($value, DataInterpreterInterface $interpreter) {
    method access (line 84) | public function access($op, DataInterpreterInterface $interpreter) {
    method addDefaults (line 103) | public function addDefaults() {
    method fieldClassName (line 143) | public static function fieldClassName(array $field_definition) {
    method compoundDocumentId (line 180) | public function compoundDocumentId(DataInterpreterInterface $interpret...
    method render (line 188) | public function render(DataInterpreterInterface $interpreter) {
    method getCardinality (line 195) | public function getCardinality() {
    method setCardinality (line 203) | public function setCardinality($cardinality) {

FILE: src/Plugin/resource/Field/ResourceFieldBase.php
  class ResourceFieldBase (line 18) | abstract class ResourceFieldBase implements ResourceFieldInterface {
    method getRequest (line 165) | public function getRequest() {
    method setRequest (line 175) | public function setRequest(RequestInterface $request) {
    method getPublicName (line 182) | public function getPublicName() {
    method setPublicName (line 189) | public function setPublicName($public_name) {
    method getAccessCallbacks (line 196) | public function getAccessCallbacks() {
    method setAccessCallbacks (line 203) | public function setAccessCallbacks($access_callbacks) {
    method getProperty (line 210) | public function getProperty() {
    method setProperty (line 217) | public function setProperty($property) {
    method getCallback (line 224) | public function getCallback() {
    method setCallback (line 231) | public function setCallback($callback) {
    method getProcessCallbacks (line 238) | public function getProcessCallbacks() {
    method setProcessCallbacks (line 245) | public function setProcessCallbacks($process_callbacks) {
    method getResource (line 252) | public function getResource() {
    method setResource (line 259) | public function setResource($resource) {
    method getMethods (line 266) | public function getMethods() {
    method setMethods (line 273) | public function setMethods($methods) {
    method id (line 285) | public function id() {
    method isComputed (line 292) | public function isComputed() {
    method isArrayNumeric (line 299) | public final static function isArrayNumeric(array $input) {
    method addMetadata (line 312) | public function addMetadata($key, $value) {
    method getMetadata (line 323) | public function getMetadata($key) {
    method getDefinition (line 334) | public function getDefinition() {
    method executeProcessCallbacks (line 341) | public function executeProcessCallbacks($value) {
    method internalMetadataElement (line 366) | protected function &internalMetadataElement($key) {
    method getPublicFieldInfo (line 384) | public function getPublicFieldInfo() {
    method setPublicFieldInfo (line 391) | public function setPublicFieldInfo(PublicFieldInfoInterface $public_fi...
    method autoDiscovery (line 401) | public function autoDiscovery() {
    method emptyDiscoveryInfo (line 416) | public static function emptyDiscoveryInfo($name) {

FILE: src/Plugin/resource/Field/ResourceFieldCollection.php
  class ResourceFieldCollection (line 15) | class ResourceFieldCollection implements ResourceFieldCollectionInterface {
    method __construct (line 129) | public function __construct(array $fields = array(), RequestInterface ...
    method factory (line 147) | public static function factory(array $fields = array(), RequestInterfa...
    method create (line 155) | public static function create() {
    method getInfo (line 162) | public static function getInfo() {
    method get (line 169) | public function get($key) {
    method set (line 176) | public function set($key, ResourceFieldInterface $field) {
    method current (line 183) | public function current() {
    method next (line 190) | public function next() {
    method key (line 197) | public function key() {
    method valid (line 204) | public function valid() {
    method rewind (line 212) | public function rewind() {
    method count (line 219) | public function count() {
    method getInterpreter (line 226) | public function getInterpreter() {
    method setInterpreter (line 233) | public function setInterpreter($interpreter) {
    method getIdField (line 240) | public function getIdField() {
    method setIdField (line 247) | public function setIdField($id_field) {
    method getResourceName (line 254) | public function getResourceName() {
    method getResourceId (line 263) | public function getResourceId() {
    method setResourceId (line 270) | public function setResourceId($resource_id) {
    method evalFilter (line 277) | public function evalFilter(array $filter) {
    method setContext (line 310) | public function setContext($context_id, ArrayCollection $context) {
    method getContext (line 317) | public function getContext() {
    method getLimitFields (line 324) | public function getLimitFields() {
    method setLimitFields (line 331) | public function setLimitFields($limit_fields) {
    method evaluateExpression (line 356) | protected static function evaluateExpression($value1, $value2, $operat...

FILE: src/Plugin/resource/Field/ResourceFieldCollectionInterface.php
  type ResourceFieldCollectionInterface (line 14) | interface ResourceFieldCollectionInterface extends \Iterator, \Countable {
    method factory (line 30) | public static function factory(array $fields = array(), RequestInterfa...
    method create (line 41) | public static function create();
    method getInfo (line 52) | public static function getInfo();
    method get (line 63) | public function get($key);
    method set (line 73) | public function set($key, ResourceFieldInterface $field);
    method setInterpreter (line 81) | public function setInterpreter($interpreter);
    method getInterpreter (line 89) | public function getInterpreter();
    method getIdField (line 97) | public function getIdField();
    method setIdField (line 105) | public function setIdField($id_field);
    method evalFilter (line 116) | public function evalFilter(array $filter);
    method setContext (line 126) | public function setContext($context_id, ArrayCollection $context);
    method getContext (line 134) | public function getContext();
    method getLimitFields (line 142) | public function getLimitFields();
    method setLimitFields (line 150) | public function setLimitFields($limit_fields);
    method getResourceName (line 158) | public function getResourceName();
    method getResourceId (line 166) | public function getResourceId();
    method setResourceId (line 174) | public function setResourceId($resource_id);

FILE: src/Plugin/resource/Field/ResourceFieldDbColumn.php
  class ResourceFieldDbColumn (line 14) | class ResourceFieldDbColumn extends ResourceField implements ResourceFie...
    method __construct (line 30) | public function __construct(array $field, RequestInterface $request) {
    method create (line 38) | public static function create(array $field, RequestInterface $request ...
    method getColumnForQuery (line 47) | public function getColumnForQuery() {
    method value (line 54) | public function value(DataInterpreterInterface $interpreter) {

FILE: src/Plugin/resource/Field/ResourceFieldDbColumnInterface.php
  type ResourceFieldDbColumnInterface (line 10) | interface ResourceFieldDbColumnInterface extends ResourceFieldInterface {
    method getColumnForQuery (line 18) | public function getColumnForQuery();

FILE: src/Plugin/resource/Field/ResourceFieldEntity.php
  class ResourceFieldEntity (line 27) | class ResourceFieldEntity implements ResourceFieldEntityInterface {
    method __construct (line 124) | public function __construct(array $field, RequestInterface $request) {
    method create (line 148) | public static function create(array $field, RequestInterface $request ...
    method value (line 184) | public function value(DataInterpreterInterface $interpreter) {
    method compoundDocumentId (line 213) | public function compoundDocumentId(DataInterpreterInterface $interpret...
    method propertyIdentifier (line 238) | protected function propertyIdentifier(\EntityMetadataWrapper $property...
    method set (line 276) | public function set($value, DataInterpreterInterface $interpreter) {
    method singleValue (line 305) | protected function singleValue(\EntityMetadataWrapper $property_wrappe...
    method access (line 387) | public function access($op, DataInterpreterInterface $interpreter) {
    method propertyWrapper (line 450) | protected function propertyWrapper(DataInterpreterInterface $interpret...
    method fieldValue (line 480) | protected function fieldValue(\EntityMetadataWrapper $property_wrapper) {
    method formatterValue (line 502) | protected function formatterValue(\EntityMetadataWrapper $property_wra...
    method nestedDottedChildren (line 544) | protected function nestedDottedChildren($key) {
    method nestedDottedFilters (line 574) | protected function nestedDottedFilters() {
    method addMetadata (line 598) | public function addMetadata($key, $value) {
    method getMetadata (line 605) | public function getMetadata($key) {
    method getRequest (line 612) | public function getRequest() {
    method setRequest (line 619) | public function setRequest(RequestInterface $request) {
    method executeProcessCallbacks (line 626) | public function executeProcessCallbacks($value) {
    method render (line 633) | public function render(DataInterpreterInterface $interpreter) {
    method getDefinition (line 640) | public function getDefinition() {
    method getPublicFieldInfo (line 647) | public function getPublicFieldInfo() {
    method setPublicFieldInfo (line 654) | public function setPublicFieldInfo(PublicFieldInfoInterface $public_fi...
    method resourceValue (line 667) | protected function resourceValue(DataInterpreterInterface $source) {}
    method decorate (line 672) | public function decorate(ResourceFieldInterface $decorated) {
    method getSubProperty (line 679) | public function getSubProperty() {
    method setSubProperty (line 686) | public function setSubProperty($sub_property) {
    method getFormatter (line 693) | public function getFormatter() {
    method setFormatter (line 700) | public function setFormatter($formatter) {
    method getWrapperMethod (line 707) | public function getWrapperMethod() {
    method setWrapperMethod (line 714) | public function setWrapperMethod($wrapper_method) {
    method isWrapperMethodOnEntity (line 721) | public function isWrapperMethodOnEntity() {
    method setWrapperMethodOnEntity (line 728) | public function setWrapperMethodOnEntity($wrapper_method_on_entity) {
    method getColumn (line 735) | public function getColumn() {
    method setColumn (line 755) | public function setColumn($column) {
    method getImageStyles (line 762) | public function getImageStyles() {
    method setImageStyles (line 769) | public function setImageStyles($image_styles) {
    method getEntityType (line 776) | public function getEntityType() {
    method setEntityType (line 783) | public function setEntityType($entity_type) {
    method entityTypeWrapper (line 793) | protected function entityTypeWrapper() {
    method getBundle (line 808) | public function getBundle() {
    method setBundle (line 815) | public function setBundle($bundle) {
    method addDefaults (line 834) | public function addDefaults() {
    method getImageUris (line 864) | public static function getImageUris(array $file_array, $image_styles) {
    method propertyIsField (line 888) | public static function propertyIsField($name) {
    method preprocess (line 895) | public function preprocess($value) {
    method fieldClassName (line 912) | public static function fieldClassName(array $field_definition) {
    method getPublicName (line 949) | public function getPublicName() {
    method setPublicName (line 956) | public function setPublicName($public_name) {
    method getAccessCallbacks (line 963) | public function getAccessCallbacks() {
    method setAccessCallbacks (line 970) | public function setAccessCallbacks($access_callbacks) {
    method getProperty (line 977) | public function getProperty() {
    method setProperty (line 984) | public function setProperty($property) {
    method getCallback (line 992) | public function getCallback() {
    method setCallback (line 999) | public function setCallback($callback) {
    method getProcessCallbacks (line 1006) | public function getProcessCallbacks() {
    method setProcessCallbacks (line 1013) | public function setProcessCallbacks($process_callbacks) {
    method getResource (line 1020) | public function getResource() {
    method setResource (line 1027) | public function setResource($resource) {
    method getMethods (line 1034) | public function getMethods() {
    method setMethods (line 1041) | public function setMethods($methods) {
    method id (line 1048) | public function id() {
    method isComputed (line 1055) | public function isComputed() {
    method autoDiscovery (line 1062) | public function autoDiscovery() {
    method getCardinality (line 1072) | public function getCardinality() {
    method setCardinality (line 1087) | public function setCardinality($cardinality) {
    method isArrayNumeric (line 1100) | public static function isArrayNumeric(array $input) {
    method buildResourceMetadataItem (line 1118) | protected function buildResourceMetadataItem($wrapper) {
    method referencedId (line 1142) | protected function referencedId($property_wrapper) {
    method propertyOnEntity (line 1151) | protected function propertyOnEntity() {
    method populatePublicInfoField (line 1192) | protected function populatePublicInfoField() {
    method fieldInfoField (line 1267) | protected static function fieldInfoField($field_name) {

FILE: src/Plugin/resource/Field/ResourceFieldEntityAlterableInterface.php
  type ResourceFieldEntityAlterableInterface (line 15) | interface ResourceFieldEntityAlterableInterface {
    method alterFilterEntityFieldQuery (line 28) | public function alterFilterEntityFieldQuery(array $filter, \EntityFiel...
    method alterSortEntityFieldQuery (line 41) | public function alterSortEntityFieldQuery(array $sort, \EntityFieldQue...

FILE: src/Plugin/resource/Field/ResourceFieldEntityFile.php
  class ResourceFieldEntityFile (line 12) | class ResourceFieldEntityFile extends ResourceFieldEntity implements Res...
    method preprocess (line 17) | public function preprocess($value) {
    method executeProcessCallbacks (line 41) | public function executeProcessCallbacks($value) {
    method getRequest (line 48) | public function getRequest() {
    method setRequest (line 55) | public function setRequest(RequestInterface $request) {
    method getDefinition (line 62) | public function getDefinition() {

FILE: src/Plugin/resource/Field/ResourceFieldEntityInterface.php
  type ResourceFieldEntityInterface (line 10) | interface ResourceFieldEntityInterface extends ResourceFieldInterface {
    method decorate (line 18) | public function decorate(ResourceFieldInterface $decorated);
    method getSubProperty (line 23) | public function getSubProperty();
    method setSubProperty (line 28) | public function setSubProperty($sub_property);
    method getFormatter (line 33) | public function getFormatter();
    method setFormatter (line 38) | public function setFormatter($formatter);
    method getWrapperMethod (line 43) | public function getWrapperMethod();
    method setWrapperMethod (line 48) | public function setWrapperMethod($wrapper_method);
    method isWrapperMethodOnEntity (line 53) | public function isWrapperMethodOnEntity();
    method setWrapperMethodOnEntity (line 58) | public function setWrapperMethodOnEntity($wrapper_method_on_entity);
    method getColumn (line 63) | public function getColumn();
    method setColumn (line 68) | public function setColumn($column);
    method getImageStyles (line 73) | public function getImageStyles();
    method setImageStyles (line 78) | public function setImageStyles($image_styles);
    method getEntityType (line 83) | public function getEntityType();
    method setEntityType (line 88) | public function setEntityType($entity_type);
    method getBundle (line 93) | public function getBundle();
    method setBundle (line 98) | public function setBundle($bundle);
    method getImageUris (line 110) | public static function getImageUris(array $file_array, $image_styles);
    method propertyIsField (line 121) | public static function propertyIsField($name);
    method preprocess (line 132) | public function preprocess($value);

FILE: src/Plugin/resource/Field/ResourceFieldEntityReference.php
  class ResourceFieldEntityReference (line 23) | class ResourceFieldEntityReference extends ResourceFieldEntity implement...
    method __construct (line 44) | public function __construct(array $field, RequestInterface $request) {
    method preprocess (line 55) | public function preprocess($value) {
    method mergeEntityFromReference (line 100) | protected function mergeEntityFromReference($value) {
    method subRequest (line 126) | public static function subRequest(array $value) {
    method subRequestId (line 168) | protected static function subRequestId($value) {
    method value (line 179) | public function value(DataInterpreterInterface $interpreter) {
    method referencedId (line 233) | protected function referencedId($property_wrapper) {
    method getRequest (line 250) | public function getRequest() {
    method setRequest (line 257) | public function setRequest(RequestInterface $request) {
    method getDefinition (line 264) | public function getDefinition() {

FILE: src/Plugin/resource/Field/ResourceFieldEntityReferenceInterface.php
  type ResourceFieldEntityReferenceInterface (line 10) | interface ResourceFieldEntityReferenceInterface extends ResourceFieldEnt...
    method subRequest (line 22) | public static function subRequest(array $value);

FILE: src/Plugin/resource/Field/ResourceFieldEntityText.php
  class ResourceFieldEntityText (line 13) | class ResourceFieldEntityText extends ResourceFieldEntity implements Res...
    method preprocess (line 18) | public function preprocess($value) {
    method executeProcessCallbacks (line 59) | public function executeProcessCallbacks($value) {
    method getRequest (line 66) | public function getRequest() {
    method setRequest (line 73) | public function setRequest(RequestInterface $request) {
    method getDefinition (line 80) | public function getDefinition() {

FILE: src/Plugin/resource/Field/ResourceFieldFileEntityReference.php
  class ResourceFieldFileEntityReference (line 15) | class ResourceFieldFileEntityReference extends ResourceFieldEntityRefere...
    method propertyIdentifier (line 27) | protected function propertyIdentifier(\EntityMetadataWrapper $property...
    method buildResourceMetadataItem (line 70) | protected function buildResourceMetadataItem($wrapper) {
    method referencedId (line 86) | protected function referencedId($property_wrapper) {
    method getRequest (line 99) | public function getRequest() {
    method setRequest (line 106) | public function setRequest(RequestInterface $request) {

FILE: src/Plugin/resource/Field/ResourceFieldInterface.php
  type ResourceFieldInterface (line 17) | interface ResourceFieldInterface {
    method getPublicName (line 22) | public function getPublicName();
    method setPublicName (line 27) | public function setPublicName($public_name);
    method getAccessCallbacks (line 32) | public function getAccessCallbacks();
    method setAccessCallbacks (line 37) | public function setAccessCallbacks($access_callbacks);
    method getProperty (line 42) | public function getProperty();
    method setProperty (line 47) | public function setProperty($property);
    method getCallback (line 52) | public function getCallback();
    method setCallback (line 57) | public function setCallback($callback);
    method getProcessCallbacks (line 62) | public function getProcessCallbacks();
    method setProcessCallbacks (line 67) | public function setProcessCallbacks($process_callbacks);
    method getResource (line 72) | public function getResource();
    method setResource (line 77) | public function setResource($resource);
    method getMethods (line 82) | public function getMethods();
    method setMethods (line 89) | public function setMethods($methods);
    method isComputed (line 97) | public function isComputed();
    method isArrayNumeric (line 108) | public static function isArrayNumeric(array $input);
    method create (line 123) | public static function create(array $field, RequestInterface $request ...
    method value (line 136) | public function value(DataInterpreterInterface $interpreter);
    method access (line 152) | public function access($op, DataInterpreterInterface $interpreter);
    method id (line 160) | public function id();
    method addDefaults (line 165) | public function addDefaults();
    method addMetadata (line 182) | public function addMetadata($key, $value);
    method getMetadata (line 196) | public function getMetadata($key);
    method set (line 208) | public function set($value, DataInterpreterInterface $interpreter);
    method executeProcessCallbacks (line 219) | public function executeProcessCallbacks($value);
    method compoundDocumentId (line 231) | public function compoundDocumentId(DataInterpreterInterface $interpret...
    method render (line 242) | public function render(DataInterpreterInterface $interpreter);
    method getCardinality (line 251) | public function getCardinality();
    method setCardinality (line 259) | public function setCardinality($cardinality);
    method getRequest (line 267) | public function getRequest();
    method setRequest (line 275) | public function setRequest(RequestInterface $request);
    method getDefinition (line 283) | public function getDefinition();
    method getPublicFieldInfo (line 291) | public function getPublicFieldInfo();
    method setPublicFieldInfo (line 299) | public function setPublicFieldInfo(PublicFieldInfoInterface $public_fi...

FILE: src/Plugin/resource/Field/ResourceFieldKeyValue.php
  class ResourceFieldKeyValue (line 13) | class ResourceFieldKeyValue extends ResourceField implements ResourceFie...
    method create (line 18) | public static function create(array $field, RequestInterface $request ...
    method value (line 28) | public function value(DataInterpreterInterface $interpreter) {

FILE: src/Plugin/resource/Field/ResourceFieldReference.php
  class ResourceFieldReference (line 29) | class ResourceFieldReference extends ResourceField {
    method compoundDocumentId (line 34) | public function compoundDocumentId(DataInterpreterInterface $interpret...

FILE: src/Plugin/resource/Field/ResourceFieldResource.php
  class ResourceFieldResource (line 17) | class ResourceFieldResource implements ResourceFieldResourceInterface, E...
    method __construct (line 65) | public function __construct(array $field, RequestInterface $request) {
    method getResourceId (line 79) | public function getResourceId(DataInterpreterInterface $interpreter) {
    method getResourceMachineName (line 90) | public function getResourceMachineName() {
    method getResourcePlugin (line 97) | public function getResourcePlugin() {
    method getCardinality (line 115) | public function getCardinality() {
    method setCardinality (line 126) | public function setCardinality($cardinality) {
    method create (line 133) | public static function create(array $field, RequestInterface $request ...
    method isArrayNumeric (line 144) | public static function isArrayNumeric(array $input) {
    method value (line 151) | public function value(DataInterpreterInterface $interpreter) {
    method access (line 158) | public function access($op, DataInterpreterInterface $interpreter) {
    method addDefaults (line 165) | public function addDefaults() {
    method set (line 172) | public function set($value, DataInterpreterInterface $interpreter) {
    method decorate (line 180) | public function decorate(ResourceFieldInterface $decorated) {
    method addMetadata (line 187) | public function addMetadata($key, $value) {
    method getMetadata (line 194) | public function getMetadata($key) {
    method executeProcessCallbacks (line 201) | public function executeProcessCallbacks($value) {
    method getPublicName (line 208) | public function getPublicName() {
    method setPublicName (line 215) | public function setPublicName($public_name) {
    method getAccessCallbacks (line 222) | public function getAccessCallbacks() {
    method setAccessCallbacks (line 229) | public function setAccessCallbacks($access_callbacks) {
    method getProperty (line 236) | public function getProperty() {
    method setProperty (line 243) | public function setProperty($property) {
    method getCallback (line 250) | public function getCallback() {
    method setCallback (line 257) | public function setCallback($callback) {
    method getProcessCallbacks (line 264) | public function getProcessCallbacks() {
    method setProcessCallbacks (line 271) | public function setProcessCallbacks($process_callbacks) {
    method getResource (line 278) | public function getResource() {
    method setResource (line 285) | public function setResource($resource) {
    method getMethods (line 292) | public function getMethods() {
    method setMethods (line 299) | public function setMethods($methods) {
    method id (line 306) | public function id() {
    method isComputed (line 313) | public function isComputed() {
    method compoundDocumentId (line 320) | public function compoundDocumentId(DataInterpreterInterface $interpret...
    method render (line 327) | public function render(DataInterpreterInterface $interpreter) {
    method __call (line 334) | public function __call($name, $arguments) {
    method getRequest (line 341) | public function getRequest() {
    method setRequest (line 348) | public function setRequest(RequestInterface $request) {
    method getDefinition (line 355) | public function getDefinition() {
    method getPublicFieldInfo (line 362) | public function getPublicFieldInfo() {
    method setPublicFieldInfo (line 369) | public function setPublicFieldInfo(PublicFieldInfoInterface $public_fi...
    method autoDiscovery (line 376) | public function autoDiscovery() {
    method getTargetColumn (line 386) | public function getTargetColumn() {
    method isInstanceOf (line 415) | public function isInstanceOf($class) {

FILE: src/Plugin/resource/Field/ResourceFieldResourceInterface.php
  type ResourceFieldResourceInterface (line 13) | interface ResourceFieldResourceInterface extends ResourceFieldInterface {
    method getResourceId (line 24) | public function getResourceId(DataInterpreterInterface $interpreter);
    method getResourceMachineName (line 32) | public function getResourceMachineName();
    method getResourcePlugin (line 40) | public function getResourcePlugin();
    method getTargetColumn (line 48) | public function getTargetColumn();

FILE: src/Plugin/resource/FilesUpload__1_0.php
  class FilesUpload__1_0 (line 33) | class FilesUpload__1_0 extends ResourceEntity {
    method __construct (line 45) | public function __construct(array $configuration, $plugin_id, $plugin_...
    method access (line 62) | public function access() {

FILE: src/Plugin/resource/LoginCookie__1_0.php
  class LoginCookie__1_0 (line 36) | class LoginCookie__1_0 extends ResourceEntity implements ResourceInterfa...
    method publicFields (line 41) | public function publicFields() {
    method controllersInfo (line 52) | public function controllersInfo() {
    method loginAndRespondWithCookie (line 66) | public function loginAndRespondWithCookie() {
    method loginUser (line 93) | public function loginUser($account) {
    method getCSRFTokenValue (line 115) | public static function getCSRFTokenValue() {
    method switchUserBack (line 123) | public function switchUserBack() {

FILE: src/Plugin/resource/Resource.php
  class Resource (line 29) | abstract class Resource extends PluginBase implements ResourceInterface {
    method __construct (line 85) | public function __construct(array $configuration, $plugin_id, $plugin_...
    method dataProviderFactory (line 95) | public function dataProviderFactory() {
    method dataProviderClassName (line 111) | protected function dataProviderClassName() {
    method getAccount (line 120) | public function getAccount($cache = TRUE) {
    method switchUserBack (line 127) | public function switchUserBack() {
    method setAccount (line 134) | public function setAccount($account) {
    method getRequest (line 142) | public function getRequest() {
    method setRequest (line 156) | public function setRequest(RequestInterface $request) {
    method getPath (line 169) | public function getPath() {
    method setPath (line 176) | public function setPath($path) {
    method getFieldDefinitions (line 184) | public function getFieldDefinitions() {
    method setFieldDefinitions (line 191) | public function setFieldDefinitions(ResourceFieldCollectionInterface $...
    method getDataProvider (line 198) | public function getDataProvider() {
    method setDataProvider (line 209) | public function setDataProvider(DataProviderInterface $data_provider =...
    method getResourceName (line 216) | public function getResourceName() {
    method getResourceMachineName (line 224) | public function getResourceMachineName() {
    method defaultConfiguration (line 232) | public function defaultConfiguration() {
    method process (line 241) | public function process() {
    method doGet (line 250) | public function doGet($path = '', array $query = array()) {
    method doPost (line 259) | public function doPost(array $parsed_body) {
    method doPatch (line 266) | public function doPatch($path, array $parsed_body) {
    method doPut (line 276) | public function doPut($path, array $parsed_body) {
    method doWrite (line 286) | private function doWrite($method, $path, array $parsed_body) {
    method doDelete (line 295) | public function doDelete($path) {
    method controllersInfo (line 307) | public function controllersInfo() {
    method getControllers (line 332) | public function getControllers() {
    method index (line 350) | public function index($path) {
    method view (line 357) | public function view($path) {
    method create (line 382) | public function create($path) {
    method update (line 391) | public function update($path) {
    method replace (line 400) | public function replace($path) {
    method remove (line 409) | public function remove($path) {
    method discover (line 417) | public function discover($path = NULL) {
    method getControllerFromPath (line 425) | public function getControllerFromPath($path = NULL, ResourceInterface ...
    method getVersion (line 478) | public function getVersion() {
    method versionedUrl (line 490) | public function versionedUrl($path = '', $options = array(), $version_...
    method getUrl (line 512) | public function getUrl(array $options = array(), $keep_query = TRUE, R...
    method access (line 538) | public function access() {
    method enable (line 545) | public function enable() {
    method disable (line 552) | public function disable() {
    method isEnabled (line 559) | public function isEnabled() {
    method setPluginDefinition (line 566) | public function setPluginDefinition(array $plugin_definition) {
    method accessByAllowOrigin (line 579) | protected function accessByAllowOrigin() {
    method publicFields (line 601) | abstract protected function publicFields();
    method processPublicFields (line 612) | protected function processPublicFields(array $field_definitions) {
    method initAuthenticationManager (line 624) | protected function initAuthenticationManager() {
    method preflight (line 655) | protected function preflight($path) {

FILE: src/Plugin/resource/ResourceDbQuery.php
  class ResourceDbQuery (line 10) | abstract class ResourceDbQuery extends Resource implements ResourceInter...
    method processPublicFields (line 21) | protected function processPublicFields(array $field_definitions) {
    method dataProviderClassName (line 36) | protected function dataProviderClassName() {

FILE: src/Plugin/resource/ResourceEntity.php
  class ResourceEntity (line 18) | abstract class ResourceEntity extends Resource {
    method __construct (line 37) | public function __construct(array $configuration, $plugin_id, $plugin_...
    method dataProviderFactory (line 56) | public function dataProviderFactory() {
    method dataProviderClassName (line 76) | protected function dataProviderClassName() {
    method publicFields (line 94) | protected function publicFields() {
    method getEntityType (line 148) | public function getEntityType() {
    method getBundles (line 158) | public function getBundles() {
    method getEntitySelf (line 171) | public function getEntitySelf(DataInterpreterInterface $interpreter) {
    method processPublicFields (line 187) | protected function processPublicFields(array $field_definitions) {
    method viewModeFields (line 212) | protected function viewModeFields(array $view_mode_info) {

FILE: src/Plugin/resource/ResourceInterface.php
  type ResourceInterface (line 28) | interface ResourceInterface extends PluginInspectionInterface, Configura...
    method dataProviderFactory (line 44) | public function dataProviderFactory();
    method getAccount (line 57) | public function getAccount($cache = TRUE);
    method switchUserBack (line 62) | public function switchUserBack();
    method setAccount (line 67) | public function setAccount($account);
    method getRequest (line 77) | public function getRequest();
    method setRequest (line 85) | public function setRequest(RequestInterface $request);
    method getPath (line 99) | public function getPath();
    method setPath (line 107) | public function setPath($path);
    method getFieldDefinitions (line 115) | public function getFieldDefinitions();
    method setFieldDefinitions (line 123) | public function setFieldDefinitions(ResourceFieldCollectionInterface $...
    method getDataProvider (line 131) | public function getDataProvider();
    method getResourceName (line 139) | public function getResourceName();
    method getResourceMachineName (line 147) | public function getResourceMachineName();
    method process (line 160) | public function process();
    method controllersInfo (line 175) | public function controllersInfo();
    method getControllers (line 201) | public function getControllers();
    method index (line 211) | public function index($path);
    method view (line 222) | public function view($path);
    method create (line 233) | public function create($path);
    method update (line 244) | public function update($path);
    method replace (line 255) | public function replace($path);
    method remove (line 262) | public function remove($path);
    method getVersion (line 271) | public function getVersion();
    method versionedUrl (line 288) | public function versionedUrl($path = '', $options = array(), $version_...
    method access (line 297) | public function access();
    method getControllerFromPath (line 320) | public function getControllerFromPath($path = NULL, ResourceInterface ...
    method enable (line 325) | public function enable();
    method disable (line 330) | public function disable();
    method isEnabled (line 338) | public function isEnabled();
    method setDataProvider (line 346) | public function setDataProvider(DataProviderInterface $data_provider =...
    method setPluginDefinition (line 354) | public function setPluginDefinition(array $plugin_definition);
    method getUrl (line 373) | public function getUrl(array $options = array(), $keep_query = TRUE, R...
    method discover (line 384) | public function discover($path = NULL);
    method doGet (line 397) | public function doGet($path = '', array $query = array());
    method doPost (line 408) | public function doPost(array $parsed_body);
    method doPatch (line 424) | public function doPatch($path, array $parsed_body);
    method doPut (line 440) | public function doPut($path, array $parsed_body);
    method doDelete (line 451) | public function doDelete($path);

FILE: src/Plugin/resource/ResourceNode.php
  class ResourceNode (line 11) | class ResourceNode extends ResourceEntity implements ResourceInterface {
    method entityPreSave (line 18) | public function entityPreSave(\EntityMetadataWrapper $wrapper) {

FILE: src/Plugin/resource/Users__1_0.php
  class Users__1_0 (line 31) | class Users__1_0 extends ResourceEntity implements ResourceInterface {
    method publicFields (line 36) | protected function publicFields() {

FILE: src/RateLimit/Entity/RateLimit.php
  class RateLimit (line 10) | class RateLimit extends \Entity {
    method hit (line 29) | public function hit() {
    method isExpired (line 37) | public function isExpired() {

FILE: src/RateLimit/Entity/RateLimitController.php
  class RateLimitController (line 10) | class RateLimitController extends \EntityAPIController {}

FILE: src/RateLimit/RateLimitManager.php
  class RateLimitManager (line 18) | class RateLimitManager implements RateLimitManagerInterface {
    method setAccount (line 48) | public function setAccount($account) {
    method getAccount (line 58) | public function getAccount() {
    method __construct (line 74) | public function __construct(ResourceInterface $resource, array $plugin...
    method checkRateLimit (line 106) | public function checkRateLimit(RequestInterface $request) {
    method deleteExpired (line 174) | public static function deleteExpired() {

FILE: src/RateLimit/RateLimitManagerInterface.php
  type RateLimitManagerInterface (line 13) | interface RateLimitManagerInterface {
    method setAccount (line 20) | public function setAccount($account);
    method getAccount (line 28) | public function getAccount();
    method checkRateLimit (line 44) | public function checkRateLimit(RequestInterface $request);
    method deleteExpired (line 49) | public static function deleteExpired();

FILE: src/RateLimit/RateLimitPluginCollection.php
  class RateLimitPluginCollection (line 12) | class RateLimitPluginCollection extends DefaultLazyPluginCollection {}

FILE: src/RenderCache/Entity/CacheFragment.php
  class CacheFragment (line 10) | class CacheFragment extends \Entity {
    method getHash (line 39) | public function getHash() {
    method setHash (line 49) | public function setHash($hash) {
    method getType (line 59) | public function getType() {
    method setType (line 69) | public function setType($type) {
    method getValue (line 79) | public function getValue() {
    method setValue (line 89) | public function setValue($value) {

FILE: src/RenderCache/Entity/CacheFragmentController.php
  class CacheFragmentController (line 18) | class CacheFragmentController extends \EntityAPIController {
    method createCacheFragments (line 48) | public function createCacheFragments(ArrayCollection $cache_fragments) {
    method existingFragments (line 81) | protected function existingFragments($hash) {
    method generateCacheHash (line 99) | public function generateCacheHash(ArrayCollection $cache_fragments) {
    method lookUpHashes (line 112) | public static function lookUpHashes(\EntityFieldQuery $query) {
    method wipe (line 128) | public function wipe() {
    method delete (line 147) | public function delete($ids, \DatabaseTransaction $transaction = NULL) {
    method fastDelete (line 167) | protected function fastDelete($ids, \DatabaseTransaction $transaction ...
    method isFastDeleteEnabled (line 194) | protected function isFastDeleteEnabled() {
    method resourceIdFromHash (line 207) | public static function resourceIdFromHash($hash) {
    method getTableName (line 229) | protected static function getTableName() {
    method getTableIdkey (line 245) | protected static function getTableIdkey() {

FILE: src/RenderCache/RenderCache.php
  class RenderCache (line 18) | class RenderCache implements RenderCacheInterface {
    method __construct (line 56) | public function __construct(ArrayCollection $cache_fragments, $hash, \...
    method create (line 67) | public static function create(ArrayCollection $cache_fragments, \Drupa...
    method get (line 76) | public function get() {
    method set (line 97) | public function set($value) {
    method clear (line 109) | public function clear() {
    method getCid (line 128) | public function getCid() {
    method generateCacheId (line 138) | protected function generateCacheId() {

FILE: src/RenderCache/RenderCacheInterface.php
  type RenderCacheInterface (line 13) | interface RenderCacheInterface {
    method create (line 27) | public static function create(ArrayCollection $cache_fragments, \Drupa...
    method get (line 35) | public function get();
    method set (line 43) | public function set($value);
    method clear (line 48) | public function clear();
    method getCid (line 56) | public function getCid();

FILE: src/Resource/EnabledArrayIterator.php
  class EnabledArrayIterator (line 10) | class EnabledArrayIterator extends \FilterIterator {
    method accept (line 20) | public function accept() {

FILE: src/Resource/ResourceManager.php
  class ResourceManager (line 18) | class ResourceManager implements ResourceManagerInterface {
    method __construct (line 49) | public function __construct(RequestInterface $request, ResourcePluginM...
    method getPlugins (line 63) | public function getPlugins($only_enabled = TRUE) {
    method getPlugin (line 86) | public function getPlugin($instance_id, RequestInterface $request = NU...
    method getPluginCopy (line 100) | public function getPluginCopy($instance_id, RequestInterface $request ...
    method clearPluginCache (line 117) | public function clearPluginCache($instance_id) {
    method getResourceIdFromRequest (line 124) | public function getResourceIdFromRequest() {
    method getVersionFromRequest (line 137) | public function getVersionFromRequest() {
    method getVersionFromProvidedRequest (line 149) | public function getVersionFromProvidedRequest(RequestInterface $reques...
    method negotiate (line 171) | public function negotiate() {
    method negotiateFromRequest (line 178) | public function negotiateFromRequest(RequestInterface $request) {
    method executeCallback (line 193) | public static function executeCallback($callback, array $params = arra...
    method isValidCallback (line 212) | public static function isValidCallback($callback) {
    method getPageArguments (line 237) | protected static function getPageArguments($path = NULL) {
    method getPageCallback (line 260) | public static function getPageCallback($path = NULL) {
    method parseVersionString (line 276) | protected function parseVersionString($version, $resource_name = NULL) {
    method getMenuItem (line 309) | protected static function getMenuItem($path = NULL) {
    method getResourceLastVersion (line 343) | public function getResourceLastVersion($resource_name, $major_version ...

FILE: src/Resource/ResourceManagerInterface.php
  type ResourceManagerInterface (line 16) | interface ResourceManagerInterface {
    method getPlugins (line 27) | public function getPlugins($only_enabled = TRUE);
    method getPlugin (line 43) | public function getPlugin($instance_id, RequestInterface $request = NU...
    method clearPluginCache (line 51) | public function clearPluginCache($instance_id);
    method getResourceIdFromRequest (line 59) | public function getResourceIdFromRequest();
    method getVersionFromRequest (line 67) | public function getVersionFromRequest();
    method getVersionFromProvidedRequest (line 79) | public function getVersionFromProvidedRequest(RequestInterface $request);
    method negotiate (line 90) | public function negotiate();
    method negotiateFromRequest (line 105) | public function negotiateFromRequest(RequestInterface $request);
    method executeCallback (line 126) | public static function executeCallback($callback, array $params = arra...
    method isValidCallback (line 143) | public static function isValidCallback($callback);
    method getResourceLastVersion (line 157) | public function getResourceLastVersion($resource_name, $major_version ...
    method getPageCallback (line 168) | public static function getPageCallback($path = NULL);
    method getPluginCopy (line 187) | public function getPluginCopy($instance_id, RequestInterface $request ...

FILE: src/Resource/ResourcePluginCollection.php
  class ResourcePluginCollection (line 12) | class ResourcePluginCollection extends DefaultLazyPluginCollection {
    method get (line 24) | public function &get($instance_id) {

FILE: src/RestfulManager.php
  class RestfulManager (line 23) | class RestfulManager {
    method getRequest (line 76) | public function getRequest() {
    method setRequest (line 86) | public function setRequest(RequestInterface $request) {
    method getResponse (line 96) | public function getResponse() {
    method setResponse (line 106) | public function setResponse(ResponseInterface $response) {
    method getResourceManager (line 115) | public function getResourceManager() {
    method setResourceManager (line 124) | public function setResourceManager(ResourceManagerInterface $resource_...
    method getFormatterManager (line 133) | public function getFormatterManager() {
    method setFormatterManager (line 142) | public function setFormatterManager(FormatterManagerInterface $formatt...
    method getPersistableCache (line 149) | public function getPersistableCache() {
    method setPersistableCache (line 156) | public function setPersistableCache($persistable_cache) {
    method __construct (line 163) | public function __construct(RequestInterface $request, ResponseInterfa...
    method createFromGlobals (line 178) | public static function createFromGlobals() {
    method process (line 194) | public function process() {
    method isRestfulPath (line 221) | public static function isRestfulPath(RequestInterface $request) {
    method echoMessage (line 236) | public static function echoMessage(DataInterpreterInterface $value, $m...

FILE: src/Util/EntityFieldQuery.php
  class EntityFieldQuery (line 13) | class EntityFieldQuery extends \EntityFieldQuery implements EntityFieldQ...
    method getRelationships (line 39) | public function getRelationships() {
    method addRelationship (line 46) | public function addRelationship(array $relational_filter) {
    method queryCallback (line 53) | public function queryCallback() {
    method buildQuery (line 65) | protected function buildQuery() {
    method finishQuery (line 76) | public function finishQuery($select_query, $id_key = 'entity_id') {
    method aliasJoinTable (line 192) | protected static function aliasJoinTable($table_name, SelectQuery $que...
    method prePropertyQuery (line 209) | protected function prePropertyQuery() {
    method fieldStorageQuery (line 298) | protected function fieldStorageQuery(SelectQuery $select_query) {
    method addFieldJoin (line 424) | protected function addFieldJoin(SelectQuery $select_query, $field_name...
    method addCondition (line 452) | public function addCondition(SelectQuery $select_query, $sql_field, $c...
    method containsLeftJoinOperator (line 478) | protected function containsLeftJoinOperator($field_name = NULL) {

FILE: src/Util/EntityFieldQueryRelationalConditionsInterface.php
  type EntityFieldQueryRelationalConditionsInterface (line 10) | interface EntityFieldQueryRelationalConditionsInterface {
    method getRelationships (line 18) | public function getRelationships();
    method addRelationship (line 26) | public function addRelationship(array $relational_filter);

FILE: src/Util/ExplorableDecoratorInterface.php
  type ExplorableDecoratorInterface (line 15) | interface ExplorableDecoratorInterface {
    method isInstanceOf (line 27) | public function isInstanceOf($class);

FILE: src/Util/PersistableCache.php
  class PersistableCache (line 10) | class PersistableCache implements PersistableCacheInterface {
    method __construct (line 39) | public function __construct($cache_bin = NULL) {
    method contains (line 47) | public function contains($key) {
    method get (line 54) | public function &get($key) {
    method set (line 68) | public function set($key, $value) {
    method delete (line 75) | public function delete($key) {
    method persist (line 82) | public function persist() {
    method __destruct (line 91) | public function __destruct() {
    method isLoaded (line 104) | protected function isLoaded($key) {
    method load (line 114) | protected function load($key) {

FILE: src/Util/PersistableCacheInterface.php
  type PersistableCacheInterface (line 10) | interface PersistableCacheInterface {
    method contains (line 21) | public function contains($key);
    method get (line 32) | public function &get($key);
    method set (line 42) | public function set($key, $value);
    method delete (line 50) | public function delete($key);
    method persist (line 55) | public function persist();

FILE: src/Util/RelationalFilter.php
  class RelationalFilter (line 15) | class RelationalFilter implements RelationalFilterInterface {
    method __construct (line 69) | public function __construct($name, $type, $column, $entity_type, array...
    method getName (line 81) | public function getName() {
    method getType (line 88) | public function getType() {
    method getEntityType (line 95) | public function getEntityType() {
    method getBundles (line 102) | public function getBundles() {
    method getColumn (line 109) | public function getColumn() {
    method getTargetColumn (line 116) | public function getTargetColumn() {

FILE: src/Util/RelationalFilterInterface.php
  type RelationalFilterInterface (line 15) | interface RelationalFilterInterface {
    method getName (line 26) | public function getName();
    method getType (line 34) | public function getType();
    method getEntityType (line 42) | public function getEntityType();
    method getBundles (line 50) | public function getBundles();
    method getColumn (line 58) | public function getColumn();
    method getTargetColumn (line 66) | public function getTargetColumn();

FILE: src/Util/StringHelper.php
  class StringHelper (line 15) | class StringHelper {
    method camelize (line 26) | public static function camelize($input) {
    method removePrefix (line 44) | public static function removePrefix($prefix, $haystack) {

FILE: tests/modules/restful_test/src/Plugin/resource/DataProvider/DataProviderFileTest.php
  class DataProviderFileTest (line 12) | class DataProviderFileTest extends DataProviderFile {
    method isUploadedFile (line 23) | protected static function isUploadedFile($filename) {
    method moveUploadedFile (line 38) | protected static function moveUploadedFile($filename, $uri) {

FILE: tests/modules/restful_test/src/Plugin/resource/db_query_test/v1/DbQueryTest__1_0.php
  class DbQueryTest__1_0 (line 37) | class DbQueryTest__1_0 extends ResourceDbQuery implements ResourceInterf...
    method publicFields (line 42) | protected function publicFields() {

FILE: tests/modules/restful_test/src/Plugin/resource/entity_test/EntityTests__1_0.php
  class EntityTests__1_0 (line 34) | class EntityTests__1_0 extends ResourceEntity implements ResourceInterfa...
    method publicFields (line 39) | protected function publicFields() {

FILE: tests/modules/restful_test/src/Plugin/resource/entity_test/main/v1/Main__1_0.php
  class Main__1_0 (line 33) | class Main__1_0 extends ResourceEntity implements ResourceInterface {}

FILE: tests/modules/restful_test/src/Plugin/resource/entity_test/main/v1/Main__1_1.php
  class Main__1_1 (line 33) | class Main__1_1 extends Main__1_0 implements ResourceInterface {
    method publicFields (line 38) | protected function publicFields() {
    method getFilesId (line 157) | public function getFilesId(array $value) {

FILE: tests/modules/restful_test/src/Plugin/resource/entity_test/main/v1/Main__1_2.php
  class Main__1_2 (line 33) | class Main__1_2 extends Main__1_0 implements ResourceInterface {
    method publicFields (line 38) | protected function publicFields() {
    method callback (line 72) | public function callback(DataInterpreterInterface $interpreter) {
    method processCallbackFromCallback (line 79) | public function processCallbackFromCallback($value) {
    method processCallbackFromValue (line 86) | public function processCallbackFromValue($value) {

FILE: tests/modules/restful_test/src/Plugin/resource/entity_test/main/v1/Main__1_3.php
  class Main__1_3 (line 32) | class Main__1_3 extends Main__1_0 implements ResourceInterface {
    method publicFields (line 37) | protected function publicFields() {

FILE: tests/modules/restful_test/src/Plugin/resource/entity_test/main/v1/Main__1_4.php
  class Main__1_4 (line 32) | class Main__1_4 extends Main__1_0 implements ResourceInterface {
    method publicFields (line 37) | protected function publicFields() {

FILE: tests/modules/restful_test/src/Plugin/resource/entity_test/main/v1/Main__1_5.php
  class Main__1_5 (line 36) | class Main__1_5 extends ResourceEntity implements ResourceInterface {
    method publicFields (line 41) | protected function publicFields() {

FILE: tests/modules/restful_test/src/Plugin/resource/entity_test/main/v1/Main__1_6.php
  class Main__1_6 (line 35) | class Main__1_6 extends Main__1_1 implements ResourceInterface {
    method publicFields (line 40) | protected function publicFields() {

FILE: tests/modules/restful_test/src/Plugin/resource/entity_test/main/v1/Main__1_7.php
  class Main__1_7 (line 36) | class Main__1_7 extends Main__1_0 implements ResourceInterface {
    method publicFields (line 41) | protected function publicFields() {
    method processPublicFields (line 99) | protected function processPublicFields(array $field_definitions) {

FILE: tests/modules/restful_test/src/Plugin/resource/entity_test/main/v1/Main__1_8.php
  class Main__1_8 (line 33) | class Main__1_8 extends Main__1_0 {
    method publicFields (line 38) | protected function publicFields() {
    method randomRelationship (line 66) | public static function randomRelationship(DataInterpreterInterface $in...
    method complexCalculation (line 80) | protected static function complexCalculation() {

FILE: tests/modules/restful_test/src/Plugin/resource/entity_test/tests/Tests__1_0.php
  class Tests__1_0 (line 32) | class Tests__1_0 extends ResourceEntity implements ResourceInterface {
    method publicFields (line 37) | protected function publicFields() {

FILE: tests/modules/restful_test/src/Plugin/resource/file/file_upload_test/v1/FilesUploadTest__1_0.php
  class FilesUploadTest__1_0 (line 32) | class FilesUploadTest__1_0 extends FilesUpload__1_0 {
    method dataProviderClassName (line 40) | protected function dataProviderClassName() {

FILE: tests/modules/restful_test/src/Plugin/resource/node/test_article/v1/TestArticles__1_0.php
  class TestArticles__1_0 (line 38) | class TestArticles__1_0 extends ResourceNode implements ResourceInterface {
    method publicFields (line 43) | protected function publicFields() {
    method processPublicFields (line 61) | protected function processPublicFields(array $field_definitions) {
    method publicFieldAccessFalse (line 89) | public static function publicFieldAccessFalse($op, ResourceFieldInterf...

FILE: tests/modules/restful_test/src/Plugin/resource/node/test_article/v1/TestArticles__1_1.php
  class TestArticles__1_1 (line 42) | class TestArticles__1_1 extends TestArticles__1_0 implements ResourceInt...

FILE: tests/modules/restful_test/src/Plugin/resource/node/test_article/v1/TestArticles__1_2.php
  class TestArticles__1_2 (line 37) | class TestArticles__1_2 extends ResourceNode implements ResourceInterface {
    method publicFields (line 42) | public function publicFields() {

FILE: tests/modules/restful_test/src/Plugin/resource/node/test_article/v1/TestArticles__1_3.php
  class TestArticles__1_3 (line 35) | class TestArticles__1_3 extends ResourceNode implements ResourceInterface {
    method controllersInfo (line 40) | public function controllersInfo() {
    method accessViewEntityFalse (line 59) | public function accessViewEntityFalse() {
    method accessViewEntityTrue (line 69) | public function accessViewEntityTrue() {

FILE: tests/modules/restful_test/src/Plugin/resource/node/test_article/v1/TestArticles__1_4.php
  class TestArticles__1_4 (line 37) | class TestArticles__1_4 extends ResourceNode implements ResourceInterface {
    method controllersInfo (line 42) | public function controllersInfo() {

FILE: tests/modules/restful_test/src/Plugin/resource/restful_test_translatable_entity/v1/RestfulTestTranslatableEntityResource__1_0.php
  class RestfulTestTranslatableEntityResource__1_0 (line 33) | class RestfulTestTranslatableEntityResource__1_0 extends Main__1_0 imple...
    method publicFields (line 38) | protected function publicFields() {

FILE: tests/modules/restful_test/src/Plugin/resource/taxonomy_term/v1/DataProviderTaxonomyTerm.php
  class DataProviderTaxonomyTerm (line 14) | class DataProviderTaxonomyTerm extends DataProviderTaxonomyTermOriginal {
    method checkEntityAccess (line 19) | protected function checkEntityAccess($op, $entity_type, $entity) {
    method checkPropertyAccess (line 27) | protected static function checkPropertyAccess(ResourceFieldInterface $...

FILE: tests/modules/restful_test/src/Plugin/resource/taxonomy_term/v1/TestTags__1_0.php
  class TestTags__1_0 (line 32) | class TestTags__1_0 extends ResourceEntity {
    method dataProviderClassName (line 37) | protected function dataProviderClassName() {
Condensed preview — 271 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,099K chars).
[
  {
    "path": ".travis.yml",
    "chars": 4238,
    "preview": "language: php\n\nphp:\n  - 5.5\n  - 5.6\n\nenv:\n  - PATH=$PATH:/home/travis/.composer/vendor/bin\n\n# This will create the datab"
  },
  {
    "path": "README.md",
    "chars": 8315,
    "preview": "[![Build Status](https://travis-ci.org/RESTful-Drupal/restful.svg?branch=7.x-2.x)](https://travis-ci.org/RESTful-Drupal/"
  },
  {
    "path": "docs/api_drupal.md",
    "chars": 6435,
    "preview": "# Using Your API Within Drupal\n\nThe RESTful module allows your resources to be used within Drupal itself. For\nexample, y"
  },
  {
    "path": "docs/api_url.md",
    "chars": 9497,
    "preview": "# Consuming your API\n\nThe RESTful module allows your resources to be used by external clients via\nHTTP requests.  This i"
  },
  {
    "path": "docs/documentation.md",
    "chars": 2849,
    "preview": "# Documenting your API\n\n## Documenting your fields\nWhen declaring a public field and its mappings, you can also provide "
  },
  {
    "path": "docs/plugin.md",
    "chars": 14059,
    "preview": "# Defining a RESTful Plugin\n\n## Resources with multiple bundles\nOne of the things that your API design should have is en"
  },
  {
    "path": "help/problem-instances-bad-request.html",
    "chars": 114,
    "preview": "<h2>Malformed syntax.</h2>\n  <p>The request could not be understood by the server due to malformed syntax.\n  </p>\n"
  },
  {
    "path": "help/problem-instances-flood.html",
    "chars": 151,
    "preview": "<h2>Rate limit exceeded.</h2>\n  <p>The user has sent too many requests in a given amount of time. Intended for\n    use w"
  },
  {
    "path": "help/problem-instances-forbidden.html",
    "chars": 207,
    "preview": "<h2>Forbidden resource access.</h2>\n  <p>The request was a valid request, but the server is refusing to respond to\n    i"
  },
  {
    "path": "help/problem-instances-gone.html",
    "chars": 567,
    "preview": "<h2>Resource no longer available.</h2>\n  <p>Indicates that the resource requested is no longer available and will not\n  "
  },
  {
    "path": "help/problem-instances-incompatible-field-definition.html",
    "chars": 218,
    "preview": "<h2>Incompatible field definition.</h2>\n  <p>The field configuration contains incompatible or conflicting field definiti"
  },
  {
    "path": "help/problem-instances-not-found.html",
    "chars": 177,
    "preview": "<h2>Document not found.</h2>\n  <p>The requested resource could not be found but may be available again in the\n    future"
  },
  {
    "path": "help/problem-instances-not-implemented.html",
    "chars": 240,
    "preview": "<h2>Operation not supported.</h2>\n  <p>This error means that the operation you are attempting on the selected\n    resour"
  },
  {
    "path": "help/problem-instances-server-configuration.html",
    "chars": 160,
    "preview": "<h2>Server configuration error.</h2>\n  <p>Some configuration for the RESTful module is causing an unrecoverable\n    erro"
  },
  {
    "path": "help/problem-instances-server-error.html",
    "chars": 119,
    "preview": "<h2>Internal server error exception.</h2>\n  <p>Generic exception thrown when there is an error in the server side.</p>\n"
  },
  {
    "path": "help/problem-instances-service-unavailable.html",
    "chars": 171,
    "preview": "<h2>Server is unavailable.</h2>\n  <p>The server is currently unavailable (because it is overloaded or down for\n    maint"
  },
  {
    "path": "help/problem-instances-unauthorized.html",
    "chars": 371,
    "preview": "<h2>Authentication needed.</h2>\n  <p>Similar to 403 Forbidden, but specifically for use when authentication is\n    requi"
  },
  {
    "path": "help/problem-instances-unprocessable-entity.html",
    "chars": 120,
    "preview": "<h2>Semantic error.</h2>\n  <p>The request was well-formed but was unable to be followed due to semantic\n    errors.</p>\n"
  },
  {
    "path": "help/problem-instances-unsupported-media-type.html",
    "chars": 262,
    "preview": "<h2>Type not supported by the server.</h2>\n  <p>The request entity has a media type which the server or resource does no"
  },
  {
    "path": "help/problem-instances.html",
    "chars": 15,
    "preview": "<h2>Index</h2>\n"
  },
  {
    "path": "help/readme.html",
    "chars": 81,
    "preview": "Go to the <a href=\"https://github.com/Gizra/restful\">project page</a> in GitHub.\n"
  },
  {
    "path": "help/restful.help.ini",
    "chars": 922,
    "preview": "[advanced help settings]\nline break = TRUE\n\n[readme]\ntitle = README\nweight = -10\n\n[problem-instances]\ntitle = RESTful pr"
  },
  {
    "path": "modules/restful_example/restful_example.info",
    "chars": 169,
    "preview": "name = RESTful example\ndescription = Example module for the RESTful module.\ncore = 7.x\ndependencies[] = restful\n\nregistr"
  },
  {
    "path": "modules/restful_example/restful_example.module",
    "chars": 66,
    "preview": "<?php\n\n/**\n * @file\n * Example module for the RESTful module.\n */\n"
  },
  {
    "path": "modules/restful_example/src/Plugin/formatter/FormatterHalXml.php",
    "chars": 1702,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\formatter\\FormatterHalJson.\n */\n\nnamespace Drupal\\restful_example"
  },
  {
    "path": "modules/restful_example/src/Plugin/resource/Tags__1_0.php",
    "chars": 1316,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_example\\Plugin\\resource\\Tags__1_0.\n */\n\nnamespace Drupal\\restful_example"
  },
  {
    "path": "modules/restful_example/src/Plugin/resource/comment/Comments__1_0.php",
    "chars": 1447,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_example\\Plugin\\resource\\comment\\Comments__1_0.\n */\n\nnamespace Drupal\\res"
  },
  {
    "path": "modules/restful_example/src/Plugin/resource/comment/DataProviderComment.php",
    "chars": 2039,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_example\\Plugin\\resource\\comment\\DataProviderComment.\n */\n\nnamespace Drup"
  },
  {
    "path": "modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_0.php",
    "chars": 916,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_example\\Plugin\\resource\\node\\article\\v1\\Articles__1_0.\n */\n\nnamespace Dr"
  },
  {
    "path": "modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_1.php",
    "chars": 997,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_example\\Plugin\\resource\\node\\article\\v1\\Articles__1_1.\n */\n\nnamespace Dr"
  },
  {
    "path": "modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_4.php",
    "chars": 1830,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_example\\Plugin\\resource\\node\\article\\v1\\Articles__1_4.\n */\n\nnamespace Dr"
  },
  {
    "path": "modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_5.php",
    "chars": 3631,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_example\\Plugin\\resource\\node\\article\\v1\\Articles__1_5.\n */\n\nnamespace Dr"
  },
  {
    "path": "modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_6.php",
    "chars": 1137,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_example\\Plugin\\resource\\node\\article\\v1\\Articles__1_6.\n */\n\nnamespace Dr"
  },
  {
    "path": "modules/restful_example/src/Plugin/resource/node/article/v1/Articles__1_7.php",
    "chars": 1011,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_example\\Plugin\\resource\\node\\article\\v1\\Articles__1_7.\n */\n\nnamespace Dr"
  },
  {
    "path": "modules/restful_example/src/Plugin/resource/node/article/v2/Articles__2_0.php",
    "chars": 768,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_example\\Plugin\\resource\\node\\article\\v2\\Articles__2_0.\n */\n\nnamespace Dr"
  },
  {
    "path": "modules/restful_example/src/Plugin/resource/node/article/v2/Articles__2_1.php",
    "chars": 1109,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_example\\Plugin\\resource\\node\\article\\v2\\Articles__2_1.\n */\n\nnamespace Dr"
  },
  {
    "path": "modules/restful_example/src/Plugin/resource/variables/DataInterpreterVariable.php",
    "chars": 307,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_example\\Plugin\\resource\\variables\\DataInterpreterVariable.\n */\n\nnamespac"
  },
  {
    "path": "modules/restful_example/src/Plugin/resource/variables/DataProviderVariable.php",
    "chars": 8034,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_example\\Plugin\\resource\\variables\\DataProviderVariable.\n */\n\nnamespace D"
  },
  {
    "path": "modules/restful_example/src/Plugin/resource/variables/DataProviderVariableInterface.php",
    "chars": 324,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_example\\Plugin\\resource\\variables\\DataProviderVariableInterface.\n */\n\nna"
  },
  {
    "path": "modules/restful_example/src/Plugin/resource/variables/Variables__1_0.php",
    "chars": 1162,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_example\\Plugin\\resource\\variables\\Variables__1_0.\n */\n\nnamespace Drupal\\"
  },
  {
    "path": "modules/restful_token_auth/modules/restful_token_auth_test/restful_token_auth_test.info",
    "chars": 211,
    "preview": "name = RESTful Token Authentication tests\ndescription = Test module that provides some example resources.\ncore = 7.x\n\nde"
  },
  {
    "path": "modules/restful_token_auth/modules/restful_token_auth_test/restful_token_auth_test.module",
    "chars": 55,
    "preview": "<?php\n\n/**\n * @file\n * Module implementation file.\n */\n"
  },
  {
    "path": "modules/restful_token_auth/modules/restful_token_auth_test/src/Plugin/resource/Articles__1_3.php",
    "chars": 795,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_token_auth_test\\Plugin\\resource\\Articles__1_3.\n */\n\nnamespace Drupal\\res"
  },
  {
    "path": "modules/restful_token_auth/restful_token_auth.admin.inc",
    "chars": 1200,
    "preview": "<?php\n\n/**\n * Menu callback; Admin settings form.\n */\nfunction restful_token_auth_admin_settings($form, &$form_state) {\n"
  },
  {
    "path": "modules/restful_token_auth/restful_token_auth.info",
    "chars": 326,
    "preview": "name = RESTful token authentication\ndescription = Authenticate a REST call using a token.\ncore = 7.x\ndependencies[] = re"
  },
  {
    "path": "modules/restful_token_auth/restful_token_auth.install",
    "chars": 3961,
    "preview": "<?php\n\n/**\n * @file\n * Install, update, and uninstall functions for the RESTful token authentication\n * module.\n */\n\n/**"
  },
  {
    "path": "modules/restful_token_auth/restful_token_auth.module",
    "chars": 4335,
    "preview": "<?php\n\n/**\n * @file\n * RESTful token authentication.\n */\n\nuse Drupal\\Component\\Plugin\\Exception\\PluginNotFoundException;"
  },
  {
    "path": "modules/restful_token_auth/src/Entity/RestfulTokenAuth.php",
    "chars": 175,
    "preview": "<?php\n\n/**\n * @file\n * Contains Drupal\\restful_token_auth\\Entity\\RestfulTokenAuth.\n */\n\nnamespace Drupal\\restful_token_a"
  },
  {
    "path": "modules/restful_token_auth/src/Entity/RestfulTokenAuthController.php",
    "chars": 2802,
    "preview": "<?php\n\n/**\n * @file\n * Contains Drupal\\restful_token_auth\\Entity\\RestfulTokenAuthController.\n */\n\nnamespace Drupal\\restf"
  },
  {
    "path": "modules/restful_token_auth/src/Plugin/authentication/TokenAuthentication.php",
    "chars": 2918,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful_token_auth\\Plugin\\authentication\\TokenAuthentication\n */\n\nnamespace Drup"
  },
  {
    "path": "modules/restful_token_auth/src/Plugin/resource/AccessToken__1_0.php",
    "chars": 2793,
    "preview": "<?php\n\n/**\n * @file\n * Contains Drupal\\restful_token_auth\\Plugin\\resource\\AccessToken__1_0.\n */\n\nnamespace Drupal\\restfu"
  },
  {
    "path": "modules/restful_token_auth/src/Plugin/resource/RefreshToken__1_0.php",
    "chars": 3276,
    "preview": "<?php\n\n/**\n * @file\n * Contains Drupal\\restful_token_auth\\Plugin\\resource\\RefreshToken__1_0.\n */\n\nnamespace Drupal\\restf"
  },
  {
    "path": "modules/restful_token_auth/src/Plugin/resource/TokenAuthenticationBase.php",
    "chars": 2112,
    "preview": "<?php\n/**\n * @file\n * Contains Drupal\\restful_token_auth\\Plugin\\resource\\TokenAuthenticationBase.\n */\n\nnamespace Drupal\\"
  },
  {
    "path": "modules/restful_token_auth/tests/RestfulTokenAuthenticationTestCase.test",
    "chars": 7429,
    "preview": "<?php\n\n/**\n * @file\n * Contains RestfulTokenAuthenticationTestCase.\n */\n\nuse Drupal\\restful\\Exception\\BadRequestExceptio"
  },
  {
    "path": "restful.admin.inc",
    "chars": 5759,
    "preview": "<?php\n\nuse Drupal\\restful\\Plugin\\FormatterPluginManager;\n\n/**\n * Menu callback; Admin settings form.\n */\nfunction restfu"
  },
  {
    "path": "restful.api.php",
    "chars": 1124,
    "preview": "<?php\n\n/**\n * @file\n * Hooks provided by the RESTful module.\n */\n\n/**\n * @addtogroup hooks\n * @{\n */\n\n\n/**\n * Allow alte"
  },
  {
    "path": "restful.cache.inc",
    "chars": 3841,
    "preview": "<?php\n\n/**\n * @file\n * Procedural implementations for cache related features.\n */\nuse Drupal\\restful\\RenderCache\\RenderC"
  },
  {
    "path": "restful.entity.inc",
    "chars": 6396,
    "preview": "<?php\n\n/**\n * @file\n * Contains entity related code.\n */\n\nuse Doctrine\\Common\\Collections\\ArrayCollection;\nuse Drupal\\re"
  },
  {
    "path": "restful.info",
    "chars": 2101,
    "preview": "name = RESTful\ndescription = Turn Drupal to a RESTful server, following best practices.\ncore = 7.x\nphp = 5.5.9\ndependenc"
  },
  {
    "path": "restful.install",
    "chars": 4069,
    "preview": "<?php\n\n/**\n * @file\n * Install, update, and uninstall functions for the RESTful module.\n */\n\n/**\n * Implements hook_sche"
  },
  {
    "path": "restful.module",
    "chars": 20072,
    "preview": "<?php\n\n/**\n * @file\n * Turn Drupal to a RESTful server, following best practices.\n */\n\ninclude_once __DIR__ . '/restful."
  },
  {
    "path": "src/Annotation/Authentication.php",
    "chars": 528,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Annotation\\RateLimit.\n */\n\nnamespace Drupal\\restful\\Annotation;\n\nuse Dru"
  },
  {
    "path": "src/Annotation/Formatter.php",
    "chars": 536,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Annotation\\Formatter.\n */\n\nnamespace Drupal\\restful\\Annotation;\n\nuse Dru"
  },
  {
    "path": "src/Annotation/RateLimit.php",
    "chars": 452,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Annotation\\RateLimit.\n */\n\nnamespace Drupal\\restful\\Annotation;\n\nuse Dru"
  },
  {
    "path": "src/Annotation/Resource.php",
    "chars": 2232,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Annotation\\Resource.\n */\n\nnamespace Drupal\\restful\\Annotation;\n\nuse Drup"
  },
  {
    "path": "src/Authentication/AuthenticationManager.php",
    "chars": 5730,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Authentication\\AuthenticationManager\n */\n\nnamespace Drupal\\restful\\Authe"
  },
  {
    "path": "src/Authentication/AuthenticationManagerInterface.php",
    "chars": 2331,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Authentication\\AuthenticationManagerInterface\n */\n\nnamespace Drupal\\rest"
  },
  {
    "path": "src/Authentication/AuthenticationPluginCollection.php",
    "chars": 270,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Authentication\\AuthenticationPluginCollection\n */\n\nnamespace Drupal\\rest"
  },
  {
    "path": "src/Authentication/UserSessionState.php",
    "chars": 2143,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Authentication\\UserSessionState.\n */\n\nnamespace Drupal\\restful\\Authentic"
  },
  {
    "path": "src/Authentication/UserSessionStateInterface.php",
    "chars": 1063,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Authentication\\UserSessionStateInterface.\n */\n\nnamespace Drupal\\restful\\"
  },
  {
    "path": "src/Exception/BadRequestException.php",
    "chars": 370,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Exception\\BadRequestException.\n */\n\nnamespace Drupal\\restful\\Exception;\n"
  },
  {
    "path": "src/Exception/FloodException.php",
    "chars": 354,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Exception\\FloodException.\n */\n\nnamespace Drupal\\restful\\Exception;\n\nclas"
  },
  {
    "path": "src/Exception/ForbiddenException.php",
    "chars": 366,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Exception\\ForbiddenException.\n */\n\nnamespace Drupal\\restful\\Exception;\n\n"
  },
  {
    "path": "src/Exception/GoneException.php",
    "chars": 468,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Exception\\GoneException.\n */\n\nnamespace Drupal\\restful\\Exception;\n\nclass"
  },
  {
    "path": "src/Exception/InaccessibleRecordException.php",
    "chars": 847,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Exception\\InaccessibleRecordException.\n */\n\nnamespace Drupal\\restful\\Exc"
  },
  {
    "path": "src/Exception/IncompatibleFieldDefinitionException.php",
    "chars": 515,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Exception\\IncompatibleFieldDefinitionException.\n */\n\nnamespace Drupal\\re"
  },
  {
    "path": "src/Exception/InternalServerErrorException.php",
    "chars": 397,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Exception\\InternalServerErrorException\n */\n\nnamespace Drupal\\restful\\Exc"
  },
  {
    "path": "src/Exception/NotFoundException.php",
    "chars": 364,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Exception\\NotFoundException.\n */\n\nnamespace Drupal\\restful\\Exception;\n\nc"
  },
  {
    "path": "src/Exception/NotImplementedException.php",
    "chars": 382,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Exception\\NotImplementedException.\n */\n\nnamespace Drupal\\restful\\Excepti"
  },
  {
    "path": "src/Exception/RestfulException.php",
    "chars": 3734,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Exception\\RestfulException.\n */\n\nnamespace Drupal\\restful\\Exception;\n\nus"
  },
  {
    "path": "src/Exception/ServerConfigurationException.php",
    "chars": 487,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Exception\\ServerConfigurationException.\n */\n\nnamespace Drupal\\restful\\Ex"
  },
  {
    "path": "src/Exception/ServiceUnavailableException.php",
    "chars": 377,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Exception\\ServiceUnavailable.\n */\n\nnamespace Drupal\\restful\\Exception;\n\n"
  },
  {
    "path": "src/Exception/UnauthorizedException.php",
    "chars": 375,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Exception\\UnauthorizedException.\n */\n\nnamespace Drupal\\restful\\Exception"
  },
  {
    "path": "src/Exception/UnprocessableEntityException.php",
    "chars": 501,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Exception\\UnprocessableEntityException.\n */\n\nnamespace Drupal\\restful\\Ex"
  },
  {
    "path": "src/Exception/UnsupportedMediaTypeException.php",
    "chars": 401,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Exception\\UnsupportedMediaTypeException.\n */\n\nnamespace Drupal\\restful\\E"
  },
  {
    "path": "src/Formatter/FormatterManager.php",
    "chars": 6521,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Formatter\\FormatterManager\n */\n\nnamespace Drupal\\restful\\Formatter;\n\nuse"
  },
  {
    "path": "src/Formatter/FormatterManagerInterface.php",
    "chars": 1847,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Formatter\\FormatterManagerInterface\n */\n\nnamespace Drupal\\restful\\Format"
  },
  {
    "path": "src/Formatter/FormatterPluginCollection.php",
    "chars": 250,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Formatter\\FormatterPluginCollection\n */\n\nnamespace Drupal\\restful\\Format"
  },
  {
    "path": "src/Http/HttpHeader.php",
    "chars": 2584,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Http\\HttpHeader\n */\n\nnamespace Drupal\\restful\\Http;\n\nclass HttpHeader im"
  },
  {
    "path": "src/Http/HttpHeaderBag.php",
    "chars": 3044,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Http\\HttpHeaderBag.\n */\n\nnamespace Drupal\\restful\\Http;\n\nclass HttpHeade"
  },
  {
    "path": "src/Http/HttpHeaderBagInterface.php",
    "chars": 1517,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Http\\HttpHeaderBagInterface.\n */\n\nnamespace Drupal\\restful\\Http;\n\nuse \\D"
  },
  {
    "path": "src/Http/HttpHeaderInterface.php",
    "chars": 1446,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Http\\HttpHeaderInterface\n */\n\nnamespace Drupal\\restful\\Http;\n\ninterface "
  },
  {
    "path": "src/Http/HttpHeaderNull.php",
    "chars": 1399,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Http\\HttpHeaderNull\n */\n\nnamespace Drupal\\restful\\Http;\n\nclass HttpHeade"
  },
  {
    "path": "src/Http/Request.php",
    "chars": 14386,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Http\\Request\n */\n\nnamespace Drupal\\restful\\Http;\nuse Drupal\\restful\\Exce"
  },
  {
    "path": "src/Http/RequestInterface.php",
    "chars": 6599,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Http\\RequestInterface.\n */\n\nnamespace Drupal\\restful\\Http;\n\ninterface Re"
  },
  {
    "path": "src/Http/Response.php",
    "chars": 11036,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Http\\Response.\n *\n * A lot of this has been extracted from the Symfony R"
  },
  {
    "path": "src/Http/ResponseInterface.php",
    "chars": 2970,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Http\\ResponseInterface.\n */\n\nnamespace Drupal\\restful\\Http;\n\nuse Drupal\\"
  },
  {
    "path": "src/Plugin/AuthenticationPluginManager.php",
    "chars": 2007,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\AuthenticationPluginManager.\n */\n\nnamespace Drupal\\restful\\Plugin"
  },
  {
    "path": "src/Plugin/ConfigurablePluginTrait.php",
    "chars": 844,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\ConfigurablePluginTrait\n */\n\nnamespace Drupal\\restful\\Plugin;\n\ntr"
  },
  {
    "path": "src/Plugin/FormatterPluginManager.php",
    "chars": 1280,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\FormatterPluginManager.\n */\n\nnamespace Drupal\\restful\\Plugin;\n\nus"
  },
  {
    "path": "src/Plugin/RateLimitPluginManager.php",
    "chars": 1284,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\RateLimitPluginManager.\n */\n\nnamespace Drupal\\restful\\Plugin;\n\nus"
  },
  {
    "path": "src/Plugin/ResourcePluginManager.php",
    "chars": 2118,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\ResourcePluginManager.\n */\n\nnamespace Drupal\\restful\\Plugin;\n\nuse"
  },
  {
    "path": "src/Plugin/SemiSingletonTrait.php",
    "chars": 837,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\SemiSingletonTrait.\n */\n\nnamespace Drupal\\restful\\Plugin;\n\n/**\n *"
  },
  {
    "path": "src/Plugin/authentication/Authentication.php",
    "chars": 955,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\authentication\\Authentication\n */\n\nnamespace Drupal\\restful\\Plugi"
  },
  {
    "path": "src/Plugin/authentication/AuthenticationInterface.php",
    "chars": 1090,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\authentication\\Authentication\n */\n\nnamespace Drupal\\restful\\Plugi"
  },
  {
    "path": "src/Plugin/authentication/BasicAuthentication.php",
    "chars": 3615,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\authentication\\BasicAuthentication\n */\n\nnamespace Drupal\\restful\\"
  },
  {
    "path": "src/Plugin/authentication/CookieAuthentication.php",
    "chars": 2046,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\authentication\\CookieAuthentication\n */\n\nnamespace Drupal\\restful"
  },
  {
    "path": "src/Plugin/authentication/OAuth2ServerAuthentication.php",
    "chars": 3309,
    "preview": "<?php\n\nnamespace Drupal\\restful\\Plugin\\authentication;\n\nuse Drupal\\Component\\Plugin\\PluginBase;\nuse Drupal\\restful\\Excep"
  },
  {
    "path": "src/Plugin/formatter/Formatter.php",
    "chars": 9948,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\formatter\\Formatter\n */\n\nnamespace Drupal\\restful\\Plugin\\formatte"
  },
  {
    "path": "src/Plugin/formatter/FormatterHalJson.php",
    "chars": 8357,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\formatter\\FormatterHalJson.\n */\n\nnamespace Drupal\\restful\\Plugin\\"
  },
  {
    "path": "src/Plugin/formatter/FormatterInterface.php",
    "chars": 2380,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\formatter\\FormatterInterface\n */\n\nnamespace Drupal\\restful\\Plugin"
  },
  {
    "path": "src/Plugin/formatter/FormatterJson.php",
    "chars": 7142,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\formatter\\FormatterJson.\n */\n\nnamespace Drupal\\restful\\Plugin\\for"
  },
  {
    "path": "src/Plugin/formatter/FormatterJsonApi.php",
    "chars": 28598,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\formatter\\FormatterJsonApi.\n */\n\nnamespace Drupal\\restful\\Plugin\\"
  },
  {
    "path": "src/Plugin/formatter/FormatterSingleJson.php",
    "chars": 1213,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\formatter\\FormatterSingleJson.\n */\n\nnamespace Drupal\\restful\\Plug"
  },
  {
    "path": "src/Plugin/rate_limit/RateLimit.php",
    "chars": 3442,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\rate_limit\\RateLimit\n */\n\nnamespace Drupal\\restful\\Plugin\\rate_li"
  },
  {
    "path": "src/Plugin/rate_limit/RateLimitGlobal.php",
    "chars": 1612,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\rate_limit\\RateLimitGlobal\n */\n\nnamespace Drupal\\restful\\Plugin\\r"
  },
  {
    "path": "src/Plugin/rate_limit/RateLimitInterface.php",
    "chars": 1854,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\rate_limit\\RateLimitInterface\n */\n\nnamespace Drupal\\restful\\Plugi"
  },
  {
    "path": "src/Plugin/rate_limit/RateLimitRequest.php",
    "chars": 576,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\rate_limit\\RateLimitRequest\n */\n\nnamespace Drupal\\restful\\Plugin\\"
  },
  {
    "path": "src/Plugin/resource/AuthenticatedResource.php",
    "chars": 3738,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\AuthenticatedResource\n */\n\nnamespace Drupal\\restful\\Plug"
  },
  {
    "path": "src/Plugin/resource/AuthenticatedResourceInterface.php",
    "chars": 753,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\AuthenticatedResourceInterface.\n */\n\nnamespace Drupal\\re"
  },
  {
    "path": "src/Plugin/resource/CrudInterface.php",
    "chars": 1839,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Resource\\CrudInterface.\n */\n\nnamespace Drupal\\restful\\Plugin\\resource;\n\n"
  },
  {
    "path": "src/Plugin/resource/CsrfToken.php",
    "chars": 1833,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\CsrfToken.\n */\n\nnamespace Drupal\\restful\\Plugin\\resource"
  },
  {
    "path": "src/Plugin/resource/DataInterpreter/ArrayWrapper.php",
    "chars": 616,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataInterpreter\\ArrayWrapper.\n */\n\nnamespace Drupal\\rest"
  },
  {
    "path": "src/Plugin/resource/DataInterpreter/ArrayWrapperInterface.php",
    "chars": 379,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataInterpreter\\ArrayWrapperInterface.\n */\n\nnamespace Dr"
  },
  {
    "path": "src/Plugin/resource/DataInterpreter/DataInterpreterArray.php",
    "chars": 260,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataInterpreter\\DataInterpreterArray.\n */\n\nnamespace Dru"
  },
  {
    "path": "src/Plugin/resource/DataInterpreter/DataInterpreterBase.php",
    "chars": 873,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataInterpreter\\DataInterpreter.\n */\n\nnamespace Drupal\\r"
  },
  {
    "path": "src/Plugin/resource/DataInterpreter/DataInterpreterEMW.php",
    "chars": 643,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataInterpreter\\DataInterpreter.\n */\n\nnamespace Drupal\\r"
  },
  {
    "path": "src/Plugin/resource/DataInterpreter/DataInterpreterInterface.php",
    "chars": 707,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataInterpreter\\DataInterpreterInterface.\n */\n\nnamespace"
  },
  {
    "path": "src/Plugin/resource/DataInterpreter/DataInterpreterPlug.php",
    "chars": 258,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataInterpreter\\DataInterpreterPlug.\n */\n\nnamespace Drup"
  },
  {
    "path": "src/Plugin/resource/DataInterpreter/PluginWrapper.php",
    "chars": 1550,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataInterpreter\\PluginWrapper.\n */\n\nnamespace Drupal\\res"
  },
  {
    "path": "src/Plugin/resource/DataInterpreter/PluginWrapperInterface.php",
    "chars": 392,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataInterpreter\\PluginWrapperInterface.\n */\n\nnamespace D"
  },
  {
    "path": "src/Plugin/resource/DataProvider/CacheDecoratedDataProvider.php",
    "chars": 6841,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataProvider\\CacheDecoratedDataProvider.\n */\n\nnamespace "
  },
  {
    "path": "src/Plugin/resource/DataProvider/CacheDecoratedDataProviderInterface.php",
    "chars": 383,
    "preview": "<?php\n\n/**\n * @file\n * Contains Drupal\\restful\\Plugin\\resource\\DataProvider\\CacheDecoratedDataProviderInterface.\n */\n\nna"
  },
  {
    "path": "src/Plugin/resource/DataProvider/DataProvider.php",
    "chars": 17024,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataProvider\\DataProvider.\n */\n\nnamespace Drupal\\restful"
  },
  {
    "path": "src/Plugin/resource/DataProvider/DataProviderDbQuery.php",
    "chars": 15687,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataProvider\\DataProviderDbQuery.\n */\n\nnamespace Drupal\\"
  },
  {
    "path": "src/Plugin/resource/DataProvider/DataProviderDbQueryInterface.php",
    "chars": 1091,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataProvider\\DataProviderDbQueryInterface.\n */\n\nnamespac"
  },
  {
    "path": "src/Plugin/resource/DataProvider/DataProviderDecorator.php",
    "chars": 4259,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataProvider\\DataProviderDecorator.\n */\n\nnamespace Drupa"
  },
  {
    "path": "src/Plugin/resource/DataProvider/DataProviderEntity.php",
    "chars": 48038,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataProvider\\DataProviderEntity.\n */\n\nnamespace Drupal\\r"
  },
  {
    "path": "src/Plugin/resource/DataProvider/DataProviderEntityDecorator.php",
    "chars": 1569,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataProvider\\DataProviderEntityDecorator.\n */\n\nnamespace"
  },
  {
    "path": "src/Plugin/resource/DataProvider/DataProviderEntityInterface.php",
    "chars": 899,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataProvider\\DataProviderEntityInterface.\n */\n\nnamespace"
  },
  {
    "path": "src/Plugin/resource/DataProvider/DataProviderFile.php",
    "chars": 12505,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataProvider\\DataProviderFile.\n */\n\nnamespace Drupal\\res"
  },
  {
    "path": "src/Plugin/resource/DataProvider/DataProviderInterface.php",
    "chars": 4460,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataProvider\\DataProviderInterface.\n */\n\nnamespace Drupa"
  },
  {
    "path": "src/Plugin/resource/DataProvider/DataProviderNode.php",
    "chars": 1148,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataProvider\\DataProviderNode.\n */\n\nnamespace Drupal\\res"
  },
  {
    "path": "src/Plugin/resource/DataProvider/DataProviderNull.php",
    "chars": 1007,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataProvider\\DataProviderNull.\n */\n\nnamespace Drupal\\res"
  },
  {
    "path": "src/Plugin/resource/DataProvider/DataProviderPlug.php",
    "chars": 8909,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataProvider\\DataProviderPlug.\n */\n\nnamespace Drupal\\res"
  },
  {
    "path": "src/Plugin/resource/DataProvider/DataProviderResource.php",
    "chars": 4332,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataProvider\\DataProviderResource.\n */\n\nnamespace Drupal"
  },
  {
    "path": "src/Plugin/resource/DataProvider/DataProviderResourceInterface.php",
    "chars": 1083,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataProvider\\DataProviderResourceInterface.\n */\n\nnamespa"
  },
  {
    "path": "src/Plugin/resource/DataProvider/DataProviderTaxonomyTerm.php",
    "chars": 874,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\DataProvider\\DataProviderEntity.\n */\n\nnamespace Drupal\\r"
  },
  {
    "path": "src/Plugin/resource/Decorators/CacheDecoratedResource.php",
    "chars": 8830,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Decorators\\CacheDecoratedResource\n */\n\nnamespace Drupal\\"
  },
  {
    "path": "src/Plugin/resource/Decorators/CacheDecoratedResourceInterface.php",
    "chars": 849,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Decorators\\CacheDecoratedResourceInterface.\n */\n\nnamespa"
  },
  {
    "path": "src/Plugin/resource/Decorators/RateLimitDecoratedResource.php",
    "chars": 2451,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Decorators\\RateLimitDecoratedResource\n */\n\nnamespace Dru"
  },
  {
    "path": "src/Plugin/resource/Decorators/ResourceDecoratorBase.php",
    "chars": 9898,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Decorators\\ResourceDecoratorBase.\n */\n\nnamespace Drupal\\"
  },
  {
    "path": "src/Plugin/resource/Decorators/ResourceDecoratorInterface.php",
    "chars": 618,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Decorators\\ResourceDecoratorInterface.\n */\n\nnamespace Dr"
  },
  {
    "path": "src/Plugin/resource/Discovery.php",
    "chars": 3390,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Discovery\n */\n\nnamespace Drupal\\restful\\Plugin\\resource;"
  },
  {
    "path": "src/Plugin/resource/Field/PublicFieldInfo/PublicFieldInfoBase.php",
    "chars": 5816,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\PublicFieldInfo\\PublicFieldInfoBase.\n */\n\nnamespac"
  },
  {
    "path": "src/Plugin/resource/Field/PublicFieldInfo/PublicFieldInfoEntity.php",
    "chars": 4337,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\PublicFieldInfo\\PublicFieldInfoEntity.\n */\n\nnamesp"
  },
  {
    "path": "src/Plugin/resource/Field/PublicFieldInfo/PublicFieldInfoEntityInterface.php",
    "chars": 747,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\PublicFieldInfo\\PublicFieldInfoEntityInterface.\n *"
  },
  {
    "path": "src/Plugin/resource/Field/PublicFieldInfo/PublicFieldInfoInterface.php",
    "chars": 1423,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\PublicFieldInfo\\PublicFieldInfoInterface.\n */\n\nnam"
  },
  {
    "path": "src/Plugin/resource/Field/PublicFieldInfo/PublicFieldInfoNull.php",
    "chars": 945,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\PublicFieldInfo\\PublicFieldInfoNull.\n */\n\nnamespac"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceField.php",
    "chars": 6293,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\ResourceField.\n */\n\nnamespace Drupal\\restful\\Plugin\\reso"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldBase.php",
    "chars": 9472,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldBase.\n */\n\nnamespace Drupal\\restful\\P"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldCollection.php",
    "chars": 10533,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldCollection.\n */\n\nnamespace Drupal\\res"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldCollectionInterface.php",
    "chars": 3843,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldCollectionInterface.\n */\n\nnamespace D"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldDbColumn.php",
    "chars": 1510,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldDbColumn.\n */\n\nnamespace Drupal\\restf"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldDbColumnInterface.php",
    "chars": 377,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldDbColumnInterface.\n */\n\nnamespace Dru"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldEntity.php",
    "chars": 38460,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldEntity\n */\n\nnamespace Drupal\\restful\\"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldEntityAlterableInterface.php",
    "chars": 1038,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldFilterableInterface.\n */\n\nnamespace D"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldEntityFile.php",
    "chars": 1360,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldEntityFile\n */\n\nnamespace Drupal\\rest"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldEntityInterface.php",
    "chars": 2621,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldEntityInterface.\n */\n\nnamespace Drupa"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldEntityReference.php",
    "chars": 8398,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldEntityReference.\n */\n\nnamespace Drupa"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldEntityReferenceInterface.php",
    "chars": 600,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldEntityReferenceInterface.\n */\n\nnamesp"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldEntityText.php",
    "chars": 1953,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldEntityText.\n */\n\nnamespace Drupal\\res"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldFileEntityReference.php",
    "chars": 3603,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldFileEntityReference.\n */\n\nnamespace D"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldInterface.php",
    "chars": 7117,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldInterface.\n */\n\nnamespace Drupal\\rest"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldKeyValue.php",
    "chars": 884,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldKeyValue.\n */\n\nnamespace Drupal\\restf"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldReference.php",
    "chars": 1487,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldReference.\n */\n\nnamespace Drupal\\rest"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldResource.php",
    "chars": 9580,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldResource.\n */\n\nnamespace Drupal\\restf"
  },
  {
    "path": "src/Plugin/resource/Field/ResourceFieldResourceInterface.php",
    "chars": 1178,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldResourceInterface.\n */\n\nnamespace Dru"
  },
  {
    "path": "src/Plugin/resource/FilesUpload__1_0.php",
    "chars": 2528,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\FilesUpload__1_0\n */\n\nnamespace Drupal\\restful\\Plugin\\re"
  },
  {
    "path": "src/Plugin/resource/LoginCookie__1_0.php",
    "chars": 3272,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\LoginCookie__1_0.\n */\n\nnamespace Drupal\\restful\\Plugin\\r"
  },
  {
    "path": "src/Plugin/resource/Resource.php",
    "chars": 21450,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Resource.\n */\n\nnamespace Drupal\\restful\\Plugin\\resource;"
  },
  {
    "path": "src/Plugin/resource/ResourceDbQuery.php",
    "chars": 1109,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\ResourceDbQuery.\n */\n\nnamespace Drupal\\restful\\Plugin\\re"
  },
  {
    "path": "src/Plugin/resource/ResourceEntity.php",
    "chars": 7497,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\ResourceEntity.\n */\n\nnamespace Drupal\\restful\\Plugin\\res"
  },
  {
    "path": "src/Plugin/resource/ResourceInterface.php",
    "chars": 11725,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\ResourceInterface.\n */\n\nnamespace Drupal\\restful\\Plugin\\"
  },
  {
    "path": "src/Plugin/resource/ResourceNode.php",
    "chars": 572,
    "preview": "<?php\n\n/**\n * @file\n * Contains Drupal\\restful\\Plugin\\resource\\ResourceNode.\n */\n\nnamespace Drupal\\restful\\Plugin\\resour"
  },
  {
    "path": "src/Plugin/resource/Users__1_0.php",
    "chars": 944,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Plugin\\resource\\Users__1_0.\n */\n\nnamespace Drupal\\restful\\Plugin\\resourc"
  },
  {
    "path": "src/RateLimit/Entity/RateLimit.php",
    "chars": 557,
    "preview": "<?php\n\n/**\n * @file\n * Contains Drupal\\restful\\RateLimit\\Entity\\RateLimit.\n */\n\nnamespace Drupal\\restful\\RateLimit\\Entit"
  },
  {
    "path": "src/RateLimit/Entity/RateLimitController.php",
    "chars": 192,
    "preview": "<?php\n\n/**\n * @file\n * Contains Drupal\\restful\\RateLimit\\Entity\\RateLimitController.\n */\n\nnamespace Drupal\\restful\\RateL"
  },
  {
    "path": "src/RateLimit/RateLimitManager.php",
    "chars": 6252,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\RateLimit\\RateLimitManager\n */\n\nnamespace Drupal\\restful\\RateLimit;\n\nuse"
  },
  {
    "path": "src/RateLimit/RateLimitManagerInterface.php",
    "chars": 1145,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\RateLimit\\RateLimitManagerInterface\n */\n\nnamespace Drupal\\restful\\RateLi"
  },
  {
    "path": "src/RateLimit/RateLimitPluginCollection.php",
    "chars": 250,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\RateLimit\\RateLimitPluginCollection\n */\n\nnamespace Drupal\\restful\\RateLi"
  },
  {
    "path": "src/RenderCache/Entity/CacheFragment.php",
    "chars": 1279,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\RenderCache\\Entity\\CacheFragment.\n */\n\nnamespace Drupal\\restful\\RenderCa"
  },
  {
    "path": "src/RenderCache/Entity/CacheFragmentController.php",
    "chars": 6940,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\RenderCache\\Entity\\CacheFragmentController.\n */\n\nnamespace Drupal\\restfu"
  },
  {
    "path": "src/RenderCache/RenderCache.php",
    "chars": 3467,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\RenderCache\\RenderCache.\n */\n\nnamespace Drupal\\restful\\RenderCache;\n\nuse"
  },
  {
    "path": "src/RenderCache/RenderCacheInterface.php",
    "chars": 1131,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\RenderCache\\RenderCacheInterface.\n */\n\nnamespace Drupal\\restful\\RenderCa"
  },
  {
    "path": "src/Resource/EnabledArrayIterator.php",
    "chars": 551,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Resource\\EnabledArrayIterator.\n */\n\nnamespace Drupal\\restful\\Resource;\n\n"
  },
  {
    "path": "src/Resource/ResourceManager.php",
    "chars": 11408,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Resource\\ResourceManager.\n */\n\nnamespace Drupal\\restful\\Resource;\n\nuse D"
  },
  {
    "path": "src/Resource/ResourceManagerInterface.php",
    "chars": 5468,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Resource\\ResourceManagerInterface.\n */\n\nnamespace Drupal\\restful\\Resourc"
  },
  {
    "path": "src/Resource/ResourcePluginCollection.php",
    "chars": 885,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\Resource\\ResourcePluginCollection\n */\n\nnamespace Drupal\\restful\\Resource"
  },
  {
    "path": "src/RestfulManager.php",
    "chars": 6064,
    "preview": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\restful\\RestfulManager.\n */\n\nnamespace Drupal\\restful;\n\nuse Drupal\\restful\\Forma"
  }
]

// ... and 71 more files (download for full content)

About this extraction

This page contains the full source code of the RESTful-Drupal/restful GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 271 files (1011.1 KB), approximately 264.6k tokens, and a symbol index with 1485 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!