compileFields example


      }

      foreach ($entity_information as $info) {
        $entity_type = \Drupal::entityTypeManager()->getDefinition($info['entity_type']);
        $base_field = !$info['revision'] ? $entity_type->getKey('id') : $entity_type->getKey('revision');
        $this->addField($info['alias']$base_field, '', $params);
      }
    }

    // Add all fields to the query.     $this->compileFields($query);

    // Add groupby.     if ($groupby) {
      foreach ($groupby as $field) {
        // Handle group by of field without table alias to avoid ambiguous         // column error.         if ($field == $this->view->storage->get('base_field')) {
          $field = $this->view->storage->get('base_table') . '.' . $field;
        }
        $query->groupBy($field);
      }
      
Home | Imprint | This part of the site doesn't use cookies.