Commit da571c5a authored by webchick's avatar webchick

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

parent 16710910
......@@ -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);
......
......@@ -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.
......
......@@ -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() {}
/**
......
......@@ -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();
......
......@@ -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"),
......
......@@ -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() {
}
......
......@@ -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() { }
}
......@@ -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);
......
......@@ -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',
......
......@@ -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);
......
......@@ -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();
......
......@@ -316,7 +316,7 @@ public function viewsFormValidate(&$form, FormStateInterface $form_state) {
}
/**
* Overrides \Drupal\views\Plugin\views\Plugin\field\FieldPluginBase::query().
* {@inheritdoc}
*/
public function query() {
}
......
......@@ -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();
......
......@@ -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();
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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.
}
......
......@@ -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);
......
......@@ -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();
......
......@@ -166,7 +166,7 @@ public static function create(ContainerInterface $container, array $configuratio
}
/**
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
* {@inheritdoc}
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
......
......@@ -19,6 +19,9 @@
*/
class FileSize extends FieldPluginBase {
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
......@@ -27,6 +30,9 @@ protected function defineOptions() {
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['file_size_display'] = array(
......
......@@ -19,6 +19,9 @@
*/
class LanguageField extends FieldPluginBase {
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['native_language'] = array('default' => FALSE);
......@@ -26,6 +29,9 @@ protected function defineOptions() {
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['native_language'] = array(
......
......@@ -26,7 +26,7 @@ public function usesGroupBy() {
}
/**
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions().
* {@inheritdoc}
*/
public function defineOptions() {
$options = parent::defineOptions();
......@@ -38,7 +38,7 @@ public function defineOptions() {
}
/**
* 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 @@ protected function getLinks() {
}
/**
* Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::query().
* {@inheritdoc}
*/
public function query() {
}
......
......@@ -46,6 +46,9 @@ public function getValueOptions() {
}
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['machine_name'] = array('default' => FALSE);
......@@ -53,6 +56,9 @@ protected function defineOptions() {
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
......@@ -64,6 +70,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
}
/**
* {@inheritdoc}
*/
public function preRender(&$values) {
$this->getValueOptions();
}
......
......@@ -27,7 +27,7 @@
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 @@ public function render(ResultRow $values) {
}
}
/**
* {@inheritdoc}
*/
public function elementType($none_supported = FALSE, $default_empty = FALSE, $inline = FALSE) {
if ($inline) {
return 'span';
......
......@@ -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 @@ protected function defineOptions() {
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['type'] = array(
'#type' => 'radios',
......
......@@ -20,6 +20,9 @@
*/
class Serialized extends FieldPluginBase {
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['format'] = array('default' => 'unserialized');
......@@ -27,7 +30,9 @@ protected function defineOptions() {
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
......@@ -54,6 +59,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
}
/**
* {@inheritdoc}
*/
public function validateOptionsForm(&$form, FormStateInterface $form_state) {
// Require a key if the format is key.