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
* @param string $part
* The box plot value key (min, first_quartile, etc.).
*
* @return mixed
* @return float|NULL
* The field value.
*
* @throws \Exception
......@@ -153,10 +153,7 @@ class BoxPlotField extends FieldPluginBase implements ContainerFactoryPluginInte
}
/**
* Set the data type for the chart field to be an array.
*
* @return string
* The data type.
* {@inheritdoc}
*/
public function getChartFieldDataType(): string {
return 'array';
......
......@@ -67,9 +67,15 @@ class CandlestickField extends FieldPluginBase implements ContainerFactoryPlugin
);
}
/**
* {@inheritdoc}
*/
public function query() {
}
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$this->field_alias = 'candlestick_field';
......@@ -81,6 +87,9 @@ class CandlestickField extends FieldPluginBase implements ContainerFactoryPlugin
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$fieldList = $this->displayHandler->getFieldLabels();
......@@ -99,7 +108,20 @@ class CandlestickField extends FieldPluginBase implements ContainerFactoryPlugin
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];
if (isset($this->view->field[$field])) {
......@@ -122,6 +144,9 @@ class CandlestickField extends FieldPluginBase implements ContainerFactoryPlugin
return JSON::encode(array_values($candlestick_values));
}
/**
* {@inheritdoc}
*/
public function getChartFieldDataType(): string {
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