You are here

public function WeightTotal::query in Ubercart 8.4

Called to add the field to a query.

Overrides FieldPluginBase::query

File

uc_order/src/Plugin/views/field/WeightTotal.php, line 21

Class

WeightTotal
Total weight field handler.

Namespace

Drupal\uc_order\Plugin\views\field

Code

public function query() {
  $this
    ->ensure_my_table();
  $table = $this->table_alias;
  $field = $this->real_field;
  $params = $this->options['group_type'] != 'group' ? [
    'function' => $this->options['group_type'],
  ] : [];
  $this->field_alias = $this->query
    ->add_field(NULL, "{$table}.{$field} * {$table}.qty", $this->table . '_' . $this->field, $params);
  $this
    ->add_additional_fields();
}