Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
da571c5a
Commit
da571c5a
authored
Feb 11, 2015
by
webchick
Browse files
Issue
#2419943
by martin107: Add inheritdoc to FieldPluginBase extending classes
parent
16710910
Changes
30
Hide whitespace changes
Inline
Side-by-side
core/modules/comment/src/Plugin/views/field/Comment.php
View file @
da571c5a
...
...
@@ -51,6 +51,9 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
}
}
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
$options
[
'link_to_comment'
]
=
array
(
'default'
=>
TRUE
);
...
...
core/modules/comment/src/Plugin/views/field/EntityLink.php
View file @
da571c5a
...
...
@@ -27,12 +27,18 @@ class EntityLink extends FieldPluginBase {
*/
protected
$build
;
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
$options
[
'teaser'
]
=
array
(
'default'
=>
FALSE
);
return
$options
;
}
/**
* {@inheritdoc}
*/
public
function
buildOptionsForm
(
&
$form
,
FormStateInterface
$form_state
)
{
$form
[
'teaser'
]
=
array
(
'#type'
=>
'checkbox'
,
...
...
@@ -44,10 +50,13 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent
::
buildOptionsForm
(
$form
,
$form_state
);
}
/**
* {@inheritdoc}
*/
public
function
query
()
{}
/**
*
Implements \Drupal\views\Plugin\views\field\FieldPluginBase::pre_render().
*
{@inheritdoc}
*/
public
function
preRender
(
&
$values
)
{
// Render all nodes, so you can grep the comment links.
...
...
core/modules/comment/src/Plugin/views/field/Link.php
View file @
da571c5a
...
...
@@ -60,6 +60,9 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition
$this
->
entityManager
=
$entity_manager
;
}
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
$options
[
'text'
]
=
array
(
'default'
=>
''
);
...
...
@@ -67,6 +70,9 @@ protected function defineOptions() {
return
$options
;
}
/**
* {@inheritdoc}
*/
public
function
buildOptionsForm
(
&
$form
,
FormStateInterface
$form_state
)
{
$form
[
'text'
]
=
array
(
'#type'
=>
'textfield'
,
...
...
@@ -81,6 +87,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent
::
buildOptionsForm
(
$form
,
$form_state
);
}
/**
* {@inheritdoc}
*/
public
function
query
()
{}
/**
...
...
core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php
View file @
da571c5a
...
...
@@ -19,6 +19,9 @@
*/
class
StatisticsLastCommentName
extends
FieldPluginBase
{
/**
* {@inheritdoc}
*/
public
function
query
()
{
// last_comment_name only contains data if the user is anonymous. So we
// have to join in a specially related user table.
...
...
@@ -48,6 +51,9 @@ public function query() {
$this
->
uid
=
$this
->
query
->
addField
(
$this
->
tableAlias
,
'last_comment_uid'
);
}
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
...
...
core/modules/comment/src/Plugin/views/field/Username.php
View file @
da571c5a
...
...
@@ -34,12 +34,18 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
$this
->
additional_fields
[
'homepage'
]
=
'homepage'
;
}
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
$options
[
'link_to_user'
]
=
array
(
'default'
=>
TRUE
);
return
$options
;
}
/**
* {@inheritdoc}
*/
public
function
buildOptionsForm
(
&
$form
,
FormStateInterface
$form_state
)
{
$form
[
'link_to_user'
]
=
array
(
'#title'
=>
$this
->
t
(
"Link this field to its user or an author's homepage"
),
...
...
core/modules/content_translation/src/Plugin/views/field/TranslationLink.php
View file @
da571c5a
...
...
@@ -22,7 +22,7 @@
class
TranslationLink
extends
FieldPluginBase
{
/**
*
Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions().
*
{@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
...
...
@@ -31,7 +31,7 @@ protected function defineOptions() {
}
/**
*
Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::buildOptionsForm().
*
{@inheritdoc}
*/
public
function
buildOptionsForm
(
&
$form
,
FormStateInterface
$form_state
)
{
$form
[
'text'
]
=
array
(
...
...
@@ -72,7 +72,7 @@ protected function renderLink(EntityInterface $entity, ResultRow $values) {
}
/**
*
Overrides \Drupal\views\Plugin\views\Plugin\field\FieldPluginBase::query().
*
{@inheritdoc}
*/
public
function
query
()
{
}
...
...
core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
View file @
da571c5a
...
...
@@ -31,6 +31,9 @@ public function usesGroupBy() {
return
FALSE
;
}
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
...
...
@@ -40,6 +43,9 @@ protected function defineOptions() {
return
$options
;
}
/**
* {@inheritdoc}
*/
public
function
buildOptionsForm
(
&
$form
,
FormStateInterface
$form_state
)
{
$all_fields
=
$this
->
view
->
display_handler
->
getFieldLabels
();
// Offer to include only those fields that follow this one.
...
...
@@ -63,6 +69,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
}
/**
* {@inheritdoc}
*/
public
function
preRender
(
&
$values
)
{
// Add a row plugin css class for the contextual link.
$class
=
'contextual-region'
;
...
...
@@ -138,6 +147,9 @@ public function render(ResultRow $values) {
}
}
/**
* {@inheritdoc}
*/
public
function
query
()
{
}
}
core/modules/file/src/Plugin/views/field/File.php
View file @
da571c5a
...
...
@@ -24,7 +24,7 @@
class
File
extends
FieldPluginBase
{
/**
*
Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
*
{@inheritdoc}
*/
public
function
init
(
ViewExecutable
$view
,
DisplayPluginBase
$display
,
array
&
$options
=
NULL
)
{
parent
::
init
(
$view
,
$display
,
$options
);
...
...
@@ -34,6 +34,9 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
}
}
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
$options
[
'link_to_file'
]
=
array
(
'default'
=>
FALSE
);
...
...
core/modules/node/src/Plugin/views/field/Link.php
View file @
da571c5a
...
...
@@ -27,12 +27,18 @@ public function usesGroupBy() {
return
FALSE
;
}
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
$options
[
'text'
]
=
array
(
'default'
=>
''
);
return
$options
;
}
/**
* {@inheritdoc}
*/
public
function
buildOptionsForm
(
&
$form
,
FormStateInterface
$form_state
)
{
$form
[
'text'
]
=
array
(
'#type'
=>
'textfield'
,
...
...
core/modules/node/src/Plugin/views/field/Node.php
View file @
da571c5a
...
...
@@ -26,7 +26,7 @@
class
Node
extends
FieldPluginBase
{
/**
*
Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
*
{@inheritdoc}
*/
public
function
init
(
ViewExecutable
$view
,
DisplayPluginBase
$display
,
array
&
$options
=
NULL
)
{
parent
::
init
(
$view
,
$display
,
$options
);
...
...
@@ -37,6 +37,9 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
}
}
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
$options
[
'link_to_node'
]
=
array
(
'default'
=>
isset
(
$this
->
definition
[
'link_to_node default'
])
?
$this
->
definition
[
'link_to_node default'
]
:
FALSE
);
...
...
core/modules/node/src/Plugin/views/field/Path.php
View file @
da571c5a
...
...
@@ -23,7 +23,7 @@
class
Path
extends
FieldPluginBase
{
/**
*
Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
*
{@inheritdoc}
*/
public
function
init
(
ViewExecutable
$view
,
DisplayPluginBase
$display
,
array
&
$options
=
NULL
)
{
parent
::
init
(
$view
,
$display
,
$options
);
...
...
@@ -31,6 +31,9 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
$this
->
additional_fields
[
'nid'
]
=
'nid'
;
}
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
$options
[
'absolute'
]
=
array
(
'default'
=>
FALSE
);
...
...
@@ -38,6 +41,9 @@ protected function defineOptions() {
return
$options
;
}
/**
* {@inheritdoc}
*/
public
function
buildOptionsForm
(
&
$form
,
FormStateInterface
$form_state
)
{
parent
::
buildOptionsForm
(
$form
,
$form_state
);
$form
[
'absolute'
]
=
array
(
...
...
@@ -49,6 +55,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
}
/**
* {@inheritdoc}
*/
public
function
query
()
{
$this
->
ensureMyTable
();
$this
->
addAdditionalFields
();
...
...
core/modules/system/src/Plugin/views/field/BulkForm.php
View file @
da571c5a
...
...
@@ -316,7 +316,7 @@ public function viewsFormValidate(&$form, FormStateInterface $form_state) {
}
/**
*
Overrides \Drupal\views\Plugin\views\Plugin\field\FieldPluginBase::query().
*
{@inheritdoc}
*/
public
function
query
()
{
}
...
...
core/modules/taxonomy/src/Plugin/views/field/LinkEdit.php
View file @
da571c5a
...
...
@@ -24,7 +24,7 @@
class
LinkEdit
extends
FieldPluginBase
{
/**
*
Overrides Drupal\views\Plugin\views\field\FieldPluginBase::init().
*
{@inheritdoc}
*/
public
function
init
(
ViewExecutable
$view
,
DisplayPluginBase
$display
,
array
&
$options
=
NULL
)
{
parent
::
init
(
$view
,
$display
,
$options
);
...
...
@@ -33,6 +33,9 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
$this
->
additional_fields
[
'vid'
]
=
'vid'
;
}
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
...
...
@@ -41,6 +44,9 @@ protected function defineOptions() {
return
$options
;
}
/**
* {@inheritdoc}
*/
public
function
buildOptionsForm
(
&
$form
,
FormStateInterface
$form_state
)
{
$form
[
'text'
]
=
array
(
'#type'
=>
'textfield'
,
...
...
@@ -50,6 +56,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent
::
buildOptionsForm
(
$form
,
$form_state
);
}
/**
* {@inheritdoc}
*/
public
function
query
()
{
$this
->
ensureMyTable
();
$this
->
addAdditionalFields
();
...
...
core/modules/user/src/Plugin/views/field/Link.php
View file @
da571c5a
...
...
@@ -32,7 +32,7 @@ public function usesGroupBy() {
}
/**
*
Overrides Drupal\views\Plugin\views\field\FieldPluginBase::init().
*
{@inheritdoc}
*/
public
function
init
(
ViewExecutable
$view
,
DisplayPluginBase
$display
,
array
&
$options
=
NULL
)
{
parent
::
init
(
$view
,
$display
,
$options
);
...
...
@@ -40,12 +40,18 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
$this
->
additional_fields
[
'uid'
]
=
'uid'
;
}
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
$options
[
'text'
]
=
array
(
'default'
=>
''
);
return
$options
;
}
/**
* {@inheritdoc}
*/
public
function
buildOptionsForm
(
&
$form
,
FormStateInterface
$form_state
)
{
$form
[
'text'
]
=
array
(
'#type'
=>
'textfield'
,
...
...
@@ -62,6 +68,9 @@ public function access(AccountInterface $account) {
return
$account
->
hasPermission
(
'administer users'
)
||
$account
->
hasPermission
(
'access user profiles'
);
}
/**
* {@inheritdoc}
*/
public
function
query
()
{
$this
->
ensureMyTable
();
$this
->
addAdditionalFields
();
...
...
core/modules/user/src/Plugin/views/field/User.php
View file @
da571c5a
...
...
@@ -23,7 +23,7 @@
class
User
extends
FieldPluginBase
{
/**
*
Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
*
{@inheritdoc}
*/
public
function
init
(
ViewExecutable
$view
,
DisplayPluginBase
$display
,
array
&
$options
=
NULL
)
{
parent
::
init
(
$view
,
$display
,
$options
);
...
...
@@ -33,6 +33,9 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
}
}
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
$options
[
'link_to_user'
]
=
array
(
'default'
=>
TRUE
);
...
...
core/modules/user/src/Plugin/views/field/UserData.php
View file @
da571c5a
...
...
@@ -50,7 +50,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition
}
/**
*
Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions().
*
{@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
...
...
@@ -62,7 +62,7 @@ protected function defineOptions() {
}
/**
*
Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions().
*
{@inheritdoc}
*/
public
function
buildOptionsForm
(
&
$form
,
FormStateInterface
$form_state
)
{
parent
::
buildOptionsForm
(
$form
,
$form_state
);
...
...
core/modules/views/src/Plugin/views/field/Boolean.php
View file @
da571c5a
...
...
@@ -33,6 +33,9 @@
*/
class
Boolean
extends
FieldPluginBase
{
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
$options
[
'type'
]
=
array
(
'default'
=>
'yes-no'
);
...
...
@@ -44,7 +47,7 @@ protected function defineOptions() {
}
/**
*
Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
*
{@inheritdoc}
*/
public
function
init
(
ViewExecutable
$view
,
DisplayPluginBase
$display
,
array
&
$options
=
NULL
)
{
parent
::
init
(
$view
,
$display
,
$options
);
...
...
@@ -62,6 +65,9 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
$this
->
formats
=
array_merge
(
$default_formats
,
$output_formats
,
$custom_format
);
}
/**
* {@inheritdoc}
*/
public
function
buildOptionsForm
(
&
$form
,
FormStateInterface
$form_state
)
{
foreach
(
$this
->
formats
as
$key
=>
$item
)
{
$options
[
$key
]
=
implode
(
'/'
,
$item
);
...
...
core/modules/views/src/Plugin/views/field/Counter.php
View file @
da571c5a
...
...
@@ -26,13 +26,18 @@ public function usesGroupBy() {
return
FALSE
;
}
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
$options
[
'counter_start'
]
=
array
(
'default'
=>
1
);
return
$options
;
}
/**
* {@inheritdoc}
*/
public
function
buildOptionsForm
(
&
$form
,
FormStateInterface
$form_state
)
{
$form
[
'counter_start'
]
=
array
(
'#type'
=>
'textfield'
,
...
...
@@ -45,6 +50,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent
::
buildOptionsForm
(
$form
,
$form_state
);
}
/**
* {@inheritdoc}
*/
public
function
query
()
{
// do nothing -- to override the parent query.
}
...
...
core/modules/views/src/Plugin/views/field/Custom.php
View file @
da571c5a
...
...
@@ -26,10 +26,16 @@ public function usesGroupBy() {
return
FALSE
;
}
/**
* {@inheritdoc}
*/
public
function
query
()
{
// do nothing -- to override the parent query.
}
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
...
...
@@ -39,6 +45,9 @@ protected function defineOptions() {
return
$options
;
}
/**
* {@inheritdoc}
*/
public
function
buildOptionsForm
(
&
$form
,
FormStateInterface
$form_state
)
{
parent
::
buildOptionsForm
(
$form
,
$form_state
);
...
...
core/modules/views/src/Plugin/views/field/Date.php
View file @
da571c5a
...
...
@@ -70,6 +70,9 @@ public static function create(ContainerInterface $container, array $configuratio
);
}
/**
* {@inheritdoc}
*/
protected
function
defineOptions
()
{
$options
=
parent
::
defineOptions
();
...
...
@@ -80,6 +83,9 @@ protected function defineOptions() {
return
$options
;
}
/**
* {@inheritdoc}
*/
public
function
buildOptionsForm
(
&
$form
,
FormStateInterface
$form_state
)
{
$date_formats
=
array
();
...
...
Prev
1
2
Next
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