public function NumericRawSQLField::query in Views Raw SQL 8
Sets the initial field data at zero.
Overrides FieldPluginBase::query
File
- src/
Plugin/ views/ field/ NumericRawSQLField.php, line 50
Class
- NumericRawSQLField
- Field handler to flag the node type.
Namespace
Drupal\views_raw_sql\Plugin\views\fieldCode
public function query() {
$this
->ensureMyTable();
// Add the field.
$group_type = $this->options['group_type'];
$params = $group_type != 'group' ? [
'function' => $group_type,
] : [];
$sql = $this->options['raw_sql'];
$this->field_alias = $this->query
->addField(NULL, $sql, 'raw_sql_field', $params);
$this
->addAdditionalFields();
}