Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Drupal.org issue queue
Drupal.org issue queue
Security & Compliance
Security & Compliance
Dependency List
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
project
drupal
Commits
d077f162
Commit
d077f162
authored
Feb 28, 2014
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2195571
by Les Lim: Add a dedicated @RestResource annotation class.
parent
78b48c89
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
7 deletions
+41
-7
core/modules/rest/lib/Drupal/rest/Annotation/RestResource.php
.../modules/rest/lib/Drupal/rest/Annotation/RestResource.php
+35
-0
core/modules/rest/lib/Drupal/rest/Plugin/Type/ResourcePluginManager.php
...est/lib/Drupal/rest/Plugin/Type/ResourcePluginManager.php
+4
-5
core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/DBLogResource.php
...st/lib/Drupal/rest/Plugin/rest/resource/DBLogResource.php
+1
-1
core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/EntityResource.php
...t/lib/Drupal/rest/Plugin/rest/resource/EntityResource.php
+1
-1
No files found.
core/modules/rest/lib/Drupal/rest/Annotation/RestResource.php
0 → 100644
View file @
d077f162
<?php
/**
* @file
* Contains \Drupal\rest\Annotation\RestResource.
*/
namespace
Drupal\rest\Annotation
;
use
\Drupal\Component\Annotation\Plugin
;
/**
* Defines a REST resource annotation object.
*
* @Annotation
*/
class
RestResource
extends
Plugin
{
/**
* The resource plugin ID.
*
* @var string
*/
public
$id
;
/**
* The human-readable name of the resource plugin.
*
* @ingroup plugin_translatable
*
* @var \Drupal\Core\Annotation\Translation
*/
public
$label
;
}
core/modules/rest/lib/Drupal/rest/Plugin/Type/ResourcePluginManager.php
View file @
d077f162
...
...
@@ -9,9 +9,8 @@
use
Drupal\Core\Cache\CacheBackendInterface
;
use
Drupal\Core\Extension\ModuleHandlerInterface
;
use
Drupal\Core\Language\LanguageManager
;
use
Drupal\Core\Language\LanguageManager
Interface
;
use
Drupal\Core\Plugin\DefaultPluginManager
;
use
Drupal\Core\Plugin\Discovery\CacheDecorator
;
/**
* Manages discovery and instantiation of resource plugins.
...
...
@@ -26,13 +25,13 @@ class ResourcePluginManager extends DefaultPluginManager {
* keyed by the corresponding namespace to look for plugin implementations.
* @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
* Cache backend instance to use.
* @param \Drupal\Core\Language\LanguageManager $language_manager
* @param \Drupal\Core\Language\LanguageManager
Interface
$language_manager
* The language manager.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler to invoke the alter hook with.
*/
public
function
__construct
(
\Traversable
$namespaces
,
CacheBackendInterface
$cache_backend
,
LanguageManager
$language_manager
,
ModuleHandlerInterface
$module_handler
)
{
parent
::
__construct
(
'Plugin/rest/resource'
,
$namespaces
);
public
function
__construct
(
\Traversable
$namespaces
,
CacheBackendInterface
$cache_backend
,
LanguageManager
Interface
$language_manager
,
ModuleHandlerInterface
$module_handler
)
{
parent
::
__construct
(
'Plugin/rest/resource'
,
$namespaces
,
'Drupal\rest\Annotation\RestResource'
);
$this
->
setCacheBackend
(
$cache_backend
,
$language_manager
,
'rest_plugins'
);
$this
->
alterInfo
(
$module_handler
,
'rest_resource'
);
...
...
core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/DBLogResource.php
View file @
d077f162
...
...
@@ -15,7 +15,7 @@
/**
* Provides a resource for database watchdog log entries.
*
* @
Plugin
(
* @
RestResource
(
* id = "dblog",
* label = @Translation("Watchdog database log")
* )
...
...
core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/EntityResource.php
View file @
d077f162
...
...
@@ -19,7 +19,7 @@
/**
* Represents entities as resources.
*
* @
Plugin
(
* @
RestResource
(
* id = "entity",
* label = @Translation("Entity"),
* serialization_class = "Drupal\Core\Entity\Entity",
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment