Skip to content

Commit

Permalink
Merge pull request #34 from cnect-web/add-reset-command
Browse files Browse the repository at this point in the history
Add better handling of entity data tables for views.
  • Loading branch information
LOBsTerr authored Apr 27, 2022
2 parents c3f7314 + b831e48 commit a4420d0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/EntityActivityTrackerViewsOperations.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,20 +219,19 @@ public function getViewsData() {
protected function getImplicitRelations() {
$id_names = [];
foreach ($this->trackerLoader->getAll() as $tracker) {
$id_names[$tracker->getTargetEntityType()] = $this->entityTypeManager->getStorage($tracker->getTargetEntityType())->getEntityType()->getKey('id');
$id_names[$tracker->getTargetEntityType()] = $this->entityTypeManager->getStorage($tracker->getTargetEntityType())->getEntityType();
}
$joins = [];

foreach ($id_names as $entity_type => $id_name) {
$table_prefix = $entity_type == 'group' ? 'groups' : $entity_type;
$joins["{$table_prefix}_field_data"] = [
'left_field' => $id_name,
foreach ($id_names as $entity_type_id => $entity_type) {
$joins[$entity_type->get('data_table')] = [
'left_field' => $entity_type->getKey('id'),
'field' => 'entity_id',
'type' => 'INNER',
'extra' => [
[
'field' => 'entity_type',
'value' => $entity_type,
'value' => $entity_type_id,
],
],
];
Expand Down

0 comments on commit a4420d0

Please sign in to comment.