Issue #2419943 by martin107: Add inheritdoc to FieldPluginBase extending classes

8.0.x
webchick 2015-02-11 14:49:56 -08:00
parent 1671091066
commit da571c5aa3
30 changed files with 184 additions and 21 deletions

View File

@ -51,6 +51,9 @@ class Comment extends FieldPluginBase {
}
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['link_to_comment'] = array('default' => TRUE);

View File

@ -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 @@ class EntityLink extends FieldPluginBase {
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.

View File

@ -60,6 +60,9 @@ class Link extends FieldPluginBase {
$this->entityManager = $entity_manager;
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['text'] = array('default' => '');
@ -67,6 +70,9 @@ class Link extends FieldPluginBase {
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['text'] = array(
'#type' => 'textfield',
@ -81,6 +87,9 @@ class Link extends FieldPluginBase {
parent::buildOptionsForm($form, $form_state);
}
/**
* {@inheritdoc}
*/
public function query() {}
/**

View File

@ -19,6 +19,9 @@ use Drupal\views\ResultRow;
*/
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 @@ class StatisticsLastCommentName extends FieldPluginBase {
$this->uid = $this->query->addField($this->tableAlias, 'last_comment_uid');
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();

View File

@ -34,12 +34,18 @@ class Username extends FieldPluginBase {
$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"),

View File

@ -22,7 +22,7 @@ use Drupal\views\ResultRow;
class TranslationLink extends FieldPluginBase {
/**
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions().
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
@ -31,7 +31,7 @@ class TranslationLink extends FieldPluginBase {
}
/**
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::buildOptionsForm().
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['text'] = array(
@ -72,7 +72,7 @@ class TranslationLink extends FieldPluginBase {
}
/**
* Overrides \Drupal\views\Plugin\views\Plugin\field\FieldPluginBase::query().
* {@inheritdoc}
*/
public function query() {
}

View File

@ -31,6 +31,9 @@ class ContextualLinks extends FieldPluginBase {
return FALSE;
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
@ -40,6 +43,9 @@ class ContextualLinks extends FieldPluginBase {
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 @@ class ContextualLinks extends FieldPluginBase {
);
}
/**
* {@inheritdoc}
*/
public function preRender(&$values) {
// Add a row plugin css class for the contextual link.
$class = 'contextual-region';
@ -138,6 +147,9 @@ class ContextualLinks extends FieldPluginBase {
}
}
/**
* {@inheritdoc}
*/
public function query() { }
}

View File

@ -24,7 +24,7 @@ use Drupal\views\Plugin\views\field\FieldPluginBase;
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 @@ class File extends FieldPluginBase {
}
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['link_to_file'] = array('default' => FALSE);

View File

@ -27,12 +27,18 @@ class Link extends FieldPluginBase {
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',

View File

@ -26,7 +26,7 @@ use Drupal\views\Plugin\views\field\FieldPluginBase;
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 @@ class Node extends FieldPluginBase {
}
}
/**
* {@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);

View File

@ -23,7 +23,7 @@ use Drupal\views\ViewExecutable;
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 @@ class Path extends FieldPluginBase {
$this->additional_fields['nid'] = 'nid';
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['absolute'] = array('default' => FALSE);
@ -38,6 +41,9 @@ class Path extends FieldPluginBase {
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['absolute'] = array(
@ -49,6 +55,9 @@ class Path extends FieldPluginBase {
);
}
/**
* {@inheritdoc}
*/
public function query() {
$this->ensureMyTable();
$this->addAdditionalFields();

View File

@ -316,7 +316,7 @@ class BulkForm extends FieldPluginBase {
}
/**
* Overrides \Drupal\views\Plugin\views\Plugin\field\FieldPluginBase::query().
* {@inheritdoc}
*/
public function query() {
}

View File

@ -24,7 +24,7 @@ use Drupal\views\ViewExecutable;
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 @@ class LinkEdit extends FieldPluginBase {
$this->additional_fields['vid'] = 'vid';
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
@ -41,6 +44,9 @@ class LinkEdit extends FieldPluginBase {
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['text'] = array(
'#type' => 'textfield',
@ -50,6 +56,9 @@ class LinkEdit extends FieldPluginBase {
parent::buildOptionsForm($form, $form_state);
}
/**
* {@inheritdoc}
*/
public function query() {
$this->ensureMyTable();
$this->addAdditionalFields();

View File

@ -32,7 +32,7 @@ class Link 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);
@ -40,12 +40,18 @@ class Link extends FieldPluginBase {
$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 @@ class Link extends FieldPluginBase {
return $account->hasPermission('administer users') || $account->hasPermission('access user profiles');
}
/**
* {@inheritdoc}
*/
public function query() {
$this->ensureMyTable();
$this->addAdditionalFields();

View File

@ -23,7 +23,7 @@ use Drupal\views\ViewExecutable;
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 @@ class User extends FieldPluginBase {
}
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['link_to_user'] = array('default' => TRUE);

View File

@ -50,7 +50,7 @@ class UserData extends FieldPluginBase {
}
/**
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions().
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
@ -62,7 +62,7 @@ class UserData extends FieldPluginBase {
}
/**
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions().
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);

View File

@ -33,6 +33,9 @@ use Drupal\views\Plugin\views\display\DisplayPluginBase;
*/
class Boolean extends FieldPluginBase {
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['type'] = array('default' => 'yes-no');
@ -44,7 +47,7 @@ class Boolean 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);
@ -62,6 +65,9 @@ class Boolean extends FieldPluginBase {
$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);

View File

@ -26,13 +26,18 @@ class Counter extends FieldPluginBase {
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 @@ class Counter extends FieldPluginBase {
parent::buildOptionsForm($form, $form_state);
}
/**
* {@inheritdoc}
*/
public function query() {
// do nothing -- to override the parent query.
}

View File

@ -26,10 +26,16 @@ class Custom extends FieldPluginBase {
return FALSE;
}
/**
* {@inheritdoc}
*/
public function query() {
// do nothing -- to override the parent query.
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
@ -39,6 +45,9 @@ class Custom extends FieldPluginBase {
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);

View File

@ -70,6 +70,9 @@ class Date extends FieldPluginBase {
);
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
@ -80,6 +83,9 @@ class Date extends FieldPluginBase {
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$date_formats = array();

View File

@ -166,7 +166,7 @@ class Field extends FieldPluginBase implements CacheablePluginInterface, MultiIt
}
/**
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
* {@inheritdoc}
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);

View File

@ -19,6 +19,9 @@ use Drupal\views\ResultRow;
*/
class FileSize extends FieldPluginBase {
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
@ -27,6 +30,9 @@ class FileSize extends FieldPluginBase {
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['file_size_display'] = array(

View File

@ -19,6 +19,9 @@ use Drupal\views\ResultRow;
*/
class LanguageField extends FieldPluginBase {
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['native_language'] = array('default' => FALSE);
@ -26,6 +29,9 @@ class LanguageField extends FieldPluginBase {
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['native_language'] = array(

View File

@ -26,7 +26,7 @@ abstract class Links extends FieldPluginBase {
}
/**
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions().
* {@inheritdoc}
*/
public function defineOptions() {
$options = parent::defineOptions();
@ -38,7 +38,7 @@ abstract class Links extends FieldPluginBase {
}
/**
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions().
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
@ -97,7 +97,7 @@ abstract class Links extends FieldPluginBase {
}
/**
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::query().
* {@inheritdoc}
*/
public function query() {
}

View File

@ -46,6 +46,9 @@ class MachineName extends FieldPluginBase {
}
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['machine_name'] = array('default' => FALSE);
@ -53,6 +56,9 @@ class MachineName extends FieldPluginBase {
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
@ -64,6 +70,9 @@ class MachineName extends FieldPluginBase {
);
}
/**
* {@inheritdoc}
*/
public function preRender(&$values) {
$this->getValueOptions();
}

View File

@ -27,7 +27,7 @@ use Drupal\views\ViewExecutable;
class Markup 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);
@ -57,6 +57,9 @@ class Markup extends FieldPluginBase {
}
}
/**
* {@inheritdoc}
*/
public function elementType($none_supported = FALSE, $default_empty = FALSE, $inline = FALSE) {
if ($inline) {
return 'span';

View File

@ -32,6 +32,9 @@ abstract class PrerenderList extends FieldPluginBase implements MultiItemsFieldH
*/
var $items = array();
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
@ -41,6 +44,9 @@ abstract class PrerenderList extends FieldPluginBase implements MultiItemsFieldH
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['type'] = array(
'#type' => 'radios',

View File

@ -20,6 +20,9 @@ use Drupal\views\ResultRow;
*/
class Serialized extends FieldPluginBase {
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['format'] = array('default' => 'unserialized');
@ -27,7 +30,9 @@ class Serialized extends FieldPluginBase {
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
@ -54,6 +59,9 @@ class Serialized extends FieldPluginBase {
);
}
/**
* {@inheritdoc}
*/
public function validateOptionsForm(&$form, FormStateInterface $form_state) {
// Require a key if the format is key.
if ($form_state->getValue(array('options', 'format')) == 'key' && $form_state->getValue(array('options', 'key')) == '') {

View File

@ -57,6 +57,9 @@ class TimeInterval extends FieldPluginBase {
);
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
@ -65,6 +68,9 @@ class TimeInterval extends FieldPluginBase {
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);

View File

@ -20,6 +20,9 @@ use Drupal\views\ResultRow;
*/
class Url extends FieldPluginBase {
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();