Skip to content
Snippets Groups Projects
Commit 59724597 authored by Daniel Cothran's avatar Daniel Cothran
Browse files

Update code documentation

parent d6373e51
No related branches found
No related tags found
2 merge requests!113fixed the issue,!75Resolve #3391197 "Enable support for"
...@@ -118,7 +118,7 @@ class BoxPlotField extends FieldPluginBase implements ContainerFactoryPluginInte ...@@ -118,7 +118,7 @@ class BoxPlotField extends FieldPluginBase implements ContainerFactoryPluginInte
* @param string $part * @param string $part
* The box plot value key (min, first_quartile, etc.). * The box plot value key (min, first_quartile, etc.).
* *
* @return mixed * @return float|NULL
* The field value. * The field value.
* *
* @throws \Exception * @throws \Exception
...@@ -153,10 +153,7 @@ class BoxPlotField extends FieldPluginBase implements ContainerFactoryPluginInte ...@@ -153,10 +153,7 @@ class BoxPlotField extends FieldPluginBase implements ContainerFactoryPluginInte
} }
/** /**
* Set the data type for the chart field to be an array. * {@inheritdoc}
*
* @return string
* The data type.
*/ */
public function getChartFieldDataType(): string { public function getChartFieldDataType(): string {
return 'array'; return 'array';
......
...@@ -67,9 +67,15 @@ class CandlestickField extends FieldPluginBase implements ContainerFactoryPlugin ...@@ -67,9 +67,15 @@ class CandlestickField extends FieldPluginBase implements ContainerFactoryPlugin
); );
} }
/**
* {@inheritdoc}
*/
public function query() { public function query() {
} }
/**
* {@inheritdoc}
*/
protected function defineOptions() { protected function defineOptions() {
$options = parent::defineOptions(); $options = parent::defineOptions();
$this->field_alias = 'candlestick_field'; $this->field_alias = 'candlestick_field';
...@@ -81,6 +87,9 @@ class CandlestickField extends FieldPluginBase implements ContainerFactoryPlugin ...@@ -81,6 +87,9 @@ class CandlestickField extends FieldPluginBase implements ContainerFactoryPlugin
return $options; return $options;
} }
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) { public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state); parent::buildOptionsForm($form, $form_state);
$fieldList = $this->displayHandler->getFieldLabels(); $fieldList = $this->displayHandler->getFieldLabels();
...@@ -99,7 +108,20 @@ class CandlestickField extends FieldPluginBase implements ContainerFactoryPlugin ...@@ -99,7 +108,20 @@ class CandlestickField extends FieldPluginBase implements ContainerFactoryPlugin
return $form; return $form;
} }
protected function getCandlestickFieldValue(ResultRow $values, $part) { /**
* Get the value of a candlestick field.
*
* @param \Drupal\views\ResultRow $values
* Row results.
* @param string $part
* The box plot value key (min, first_quartile, etc.).
*
* @return float|NULL
* The field value.
*
* @throws \Exception
*/
protected function getCandlestickFieldValue(ResultRow $values, string $part) {
$field = $this->options[$part]; $field = $this->options[$part];
if (isset($this->view->field[$field])) { if (isset($this->view->field[$field])) {
...@@ -122,6 +144,9 @@ class CandlestickField extends FieldPluginBase implements ContainerFactoryPlugin ...@@ -122,6 +144,9 @@ class CandlestickField extends FieldPluginBase implements ContainerFactoryPlugin
return JSON::encode(array_values($candlestick_values)); return JSON::encode(array_values($candlestick_values));
} }
/**
* {@inheritdoc}
*/
public function getChartFieldDataType(): string { public function getChartFieldDataType(): string {
return 'array'; return 'array';
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment