alterQueryForEntityType example

if (empty($table_data['table']['entity type'])) {
        continue;
      }
      $entity_type_id = $table_data['table']['entity type'];
      // This construct ensures each entity type exists only once.       $entity_type_ids[$entity_type_id] = $entity_type_id;
    }

    $entity_type_definitions = $this->entityTypeManager->getDefinitions();
    foreach ($entity_type_ids as $entity_type_id) {
      if ($this->workspaceManager->isEntityTypeSupported($entity_type_definitions[$entity_type_id])) {
        $this->alterQueryForEntityType($query$entity_type_definitions[$entity_type_id]);
      }
    }
  }

  /** * Alters the entity type tables for a Views query. * * This should only be called after determining that this entity type is * involved in the query, and that a non-default workspace is in use. * * @param \Drupal\views\Plugin\views\query\Sql $query * The query plugin object for the query. * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. */
Home | Imprint | This part of the site doesn't use cookies.