Commit ee1c53e5 authored by alexpott's avatar alexpott

Issue #1965164 by tim.plunkett: Add dedicated annotations for Views handlers.

parent 809138a7
<?php
/**
* @file
* Contains Drupal\Component\Annotation\PluginID.
*/
namespace Drupal\Component\Annotation;
/**
* Defines a Plugin annotation object that just contains an ID.
*
* @Annotation
*/
class PluginID implements AnnotationInterface {
/**
* The plugin ID.
*
* When an annotation is given no key, 'value' is assumed by Doctrine.
*
* @var string
*/
public $value;
/**
* Implements \Drupal\Core\Annotation\AnnotationInterface::get().
*/
public function get() {
return array(
'id' => $this->value,
);
}
}
......@@ -7,16 +7,13 @@
namespace Drupal\action\Plugin\views\field;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
use Drupal\system\Plugin\views\field\BulkFormBase;
/**
* Defines a actions-based bulk operation form element.
*
* @Plugin(
* id = "action_bulk_form",
* module = "action"
* )
* @PluginID("action_bulk_form")
*/
class BulkForm extends BulkFormBase {
......
......@@ -8,7 +8,7 @@
namespace Drupal\comment\Plugin\views\argument;
use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Argument handler to accept a user id to check for nodes that
......@@ -16,10 +16,7 @@
*
* @ingroup views_argument_handlers
*
* @Plugin(
* id = "argument_comment_user_uid",
* module = "comment"
* )
* @PluginID("argument_comment_user_uid")
*/
class UserUid extends ArgumentPluginBase {
......
......@@ -10,17 +10,14 @@
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Field handler to allow linking to a comment.
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "comment",
* module = "comment"
* )
* @PluginID("comment")
*/
class Comment extends FieldPluginBase {
......
......@@ -7,7 +7,7 @@
namespace Drupal\comment\Plugin\views\field;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
use Drupal\views\Plugin\views\field\FieldPluginBase;
/**
......@@ -15,10 +15,7 @@
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "comment_depth",
* module = "comment"
* )
* @PluginID("comment_depth")
*/
class Depth extends FieldPluginBase {
......
......@@ -10,17 +10,14 @@
use Drupal\views\Plugin\views\field\Date;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Field handler to display the timestamp of a comment with the count of comments.
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "comment_last_timestamp",
* module = "comment"
* )
* @PluginID("comment_last_timestamp")
*/
class LastTimestamp extends Date {
......
......@@ -8,17 +8,14 @@
namespace Drupal\comment\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Base field handler to present a link.
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "comment_link",
* module = "comment"
* )
* @PluginID("comment_link")
*/
class Link extends FieldPluginBase {
......
......@@ -7,17 +7,14 @@
namespace Drupal\comment\Plugin\views\field;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Provides a comment approve link.
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "comment_link_approve",
* module = "comment"
* )
* @PluginID("comment_link_approve")
*/
class LinkApprove extends Link {
......
......@@ -7,17 +7,14 @@
namespace Drupal\comment\Plugin\views\field;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Field handler to present a link to delete a node.
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "comment_link_delete",
* module = "comment"
* )
* @PluginID("comment_link_delete")
*/
class LinkDelete extends Link {
......
......@@ -7,17 +7,14 @@
namespace Drupal\comment\Plugin\views\field;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Field handler to present a link node edit.
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "comment_link_edit",
* module = "comment"
* )
* @PluginID("comment_link_edit")
*/
class LinkEdit extends Link {
......
......@@ -7,17 +7,14 @@
namespace Drupal\comment\Plugin\views\field;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Field handler to present a link to delete a node.
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "comment_link_reply",
* module = "comment"
* )
* @PluginID("comment_link_reply")
*/
class LinkReply extends Link {
......
......@@ -8,17 +8,14 @@
namespace Drupal\comment\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Field handler to present the name of the last comment poster.
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "comment_ncs_last_comment_name",
* module = "comment"
* )
* @PluginID("comment_ncs_last_comment_name")
*/
class NcsLastCommentName extends FieldPluginBase {
......
......@@ -8,17 +8,14 @@
namespace Drupal\comment\Plugin\views\field;
use Drupal\views\Plugin\views\field\Date;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Field handler to display the newer of last comment / node updated.
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "comment_ncs_last_updated",
* module = "comment"
* )
* @PluginID("comment_ncs_last_updated")
*/
class NcsLastUpdated extends Date {
......
......@@ -8,17 +8,14 @@
namespace Drupal\comment\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Display node comment status.
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "node_comment",
* module = "comment"
* )
* @PluginID("node_comment")
*/
class NodeComment extends FieldPluginBase {
......
......@@ -8,17 +8,14 @@
namespace Drupal\comment\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Handler for showing comment module's node link.
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "comment_node_link",
* module = "comment"
* )
* @PluginID("comment_node_link")
*/
class NodeLink extends FieldPluginBase {
......
......@@ -10,17 +10,14 @@
use Drupal\views\Plugin\views\field\Numeric;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ViewExecutable;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Field handler to display the number of new comments.
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "node_new_comments",
* module = "comment"
* )
* @PluginID("node_new_comments")
*/
class NodeNewComments extends Numeric {
......
......@@ -10,17 +10,14 @@
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Field handler to allow linking to a user account or homepage.
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "comment_username",
* module = "comment"
* )
* @PluginID("comment_username")
*/
class Username extends FieldPluginBase {
......
......@@ -8,17 +8,14 @@
namespace Drupal\comment\Plugin\views\filter;
use Drupal\views\Plugin\views\filter\Date;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Filter handler for the newer of last comment / node updated.
*
* @ingroup views_filter_handlers
*
* @Plugin(
* id = "ncs_last_updated",
* module = "comment"
* )
* @PluginID("ncs_last_updated")
*/
class NcsLastUpdated extends Date {
......
......@@ -8,17 +8,14 @@
namespace Drupal\comment\Plugin\views\filter;
use Drupal\views\Plugin\views\filter\InOperator;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Filter based on comment node status.
*
* @ingroup views_filter_handlers
*
* @Plugin(
* id = "node_comment",
* module = "comment"
* )
* @PluginID("node_comment")
*/
class NodeComment extends InOperator {
......
......@@ -8,7 +8,7 @@
namespace Drupal\comment\Plugin\views\filter;
use Drupal\views\Plugin\views\filter\FilterPluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Filter handler to accept a user id to check for nodes that user posted or
......@@ -16,10 +16,7 @@
*
* @ingroup views_filter_handlers
*
* @Plugin(
* id = "comment_user_uid",
* module = "comment"
* )
* @PluginID("comment_user_uid")
*/
class UserUid extends FilterPluginBase {
......
......@@ -8,7 +8,7 @@
namespace Drupal\comment\Plugin\views\sort;
use Drupal\views\Plugin\views\sort\SortPluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Sort handler to sort by last comment name which might be in 2 different
......@@ -16,10 +16,7 @@
*
* @ingroup views_sort_handlers
*
* @Plugin(
* id = "comment_ncs_last_comment_name",
* module = "comment"
* )
* @PluginID("comment_ncs_last_comment_name")
*/
class NcsLastCommentName extends SortPluginBase {
......
......@@ -8,17 +8,14 @@
namespace Drupal\comment\Plugin\views\sort;
use Drupal\views\Plugin\views\sort\Date;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Sort handler for the newer of last comment / node updated.
*
* @ingroup views_sort_handlers
*
* @Plugin(
* id = "ncs_last_updated",
* module = "comment"
* )
* @PluginID("ncs_last_updated")
*/
class NcsLastUpdated extends Date {
......
......@@ -8,17 +8,14 @@
namespace Drupal\comment\Plugin\views\sort;
use Drupal\views\Plugin\views\sort\SortPluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Sort handler for ordering by thread.
*
* @ingroup views_sort_handlers
*
* @Plugin(
* id = "comment_thread",
* module = "comment"
* )
* @PluginID("comment_thread")
*/
class Thread extends SortPluginBase {
......
......@@ -7,7 +7,7 @@
namespace Drupal\contextual\Plugin\views\field;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
use Drupal\views\Plugin\views\field\FieldPluginBase;
/**
......@@ -15,10 +15,7 @@
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "contextual_links",
* module = "contextual"
* )
* @PluginID("contextual_links")
*/
class ContextualLinks extends FieldPluginBase {
......
......@@ -10,7 +10,7 @@
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\argument\Numeric;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Argument handler for list field to show the human readable name in the
......@@ -18,10 +18,7 @@
*
* @ingroup views_argument_handlers
*
* @Plugin(
* id = "field_list",
* module = "field"
* )
* @PluginID("field_list")
*/
class FieldList extends Numeric {
......
......@@ -10,7 +10,7 @@
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\argument\String;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Argument handler for list field to show the human readable name in the
......@@ -18,10 +18,7 @@
*
* @ingroup views_argument_handlers
*
* @Plugin(
* id = "field_list_string",
* module = "field"
* )
* @PluginID("field_list_string")
*/
class ListString extends String {
......
......@@ -11,7 +11,7 @@
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
use Drupal\views\Views;
/**
......@@ -19,10 +19,7 @@
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "field",
* module = "field"
* )
* @PluginID("field")
*/
class Field extends FieldPluginBase {
......
......@@ -8,17 +8,14 @@
namespace Drupal\field\Plugin\views\filter;
use Drupal\views\Plugin\views\filter\ManyToOne;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
/**
* Filter handler which uses list-fields as options.
*
* @ingroup views_filter_handlers
*
* @Plugin(
* id = "field_list",
* module = "field"
* )
* @PluginID("field_list")
*/
class FieldList extends ManyToOne {
......
......@@ -10,7 +10,7 @@
use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\relationship\RelationshipPluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
use Drupal\views\Views;
/**
......@@ -18,10 +18,7 @@
*
* @ingroup views_relationship_handlers
*
* @Plugin(
* id = "entity_reverse",
* module = "field"
* )
* @PluginID("entity_reverse")
*/
class EntityReverse extends RelationshipPluginBase {
......
......@@ -7,7 +7,7 @@
namespace Drupal\file\Plugin\views\argument;
use Drupal\Component\Annotation\Plugin;
use Drupal\Component\Annotation\PluginID;
use Drupal\views\Plugin\views\argument\Numeric;
/**
......@@ -15,10 +15,7 @@
*
* @ingroup views_argument_handlers
*
* @Plugin(
* id = "file_fid",
* module = "file"
* )
* @PluginID("file_fid")
*/
class Fid extends Numeric {
......
......@@ -7,7 +7,7 @@
namespace Drupal\file\Plugin\views\field;
use Drupal\Component\Annotation\Plugin;