protected function getAggregationAuthorsCount(array $data) {
    $count = 0;
    $related_object = $data['related_object'][0];
    if (isset($related_object['target_type']) && $related_object['target_type'] === 'comment') {
      // Get related entity.
      $related_entity = $this->getActivityRelatedEntity($data);
      if (!empty($related_entity['target_id']) && !empty($related_entity['target_type'])) {
        $query = \Drupal::database()->select('comment_field_data', 'cfd');
        $query->addExpression('COUNT(DISTINCT cfd.uid)');
        $query->condition('cfd.status', 1);
        $query->condition('cfd.entity_type', $related_entity['target_type']);
        $query->condition('cfd.entity_id', $related_entity['target_id']);
        $count = $query->execute()->fetchField();
      }
    }
    return $count;
  }
protected function getAggregationAuthorsCount(array $data) {
    $count = 0;
    $related_object = $data['related_object'][0];
    if (isset($related_object['target_type']) && $related_object['target_type'] === 'comment') {
      // Get related entity.
      $related_entity = $this->getActivityRelatedEntity($data);
      if (!empty($related_entity['target_id']) && !empty($related_entity['target_type'])) {
        $query = \Drupal::database()->select('comment_field_data', 'cfd');
        $query->addExpression('COUNT(DISTINCT cfd.uid)');
        $query->condition('cfd.status', 1);
        $query->condition('cfd.entity_type', $related_entity['target_type']);
        $query->condition('cfd.entity_id', $related_entity['target_id']);
        $count = $query->execute()->fetchField();
      }
    }
    return $count;
  }
protected function getAggregationAuthorsCount ( array $ data ) { $ count = 0 ; $ related_object = $ data [ 'related_object' ] [ 0 ] ; if ( isset ( $ related_object [ 'target_type' ] ) && $ related_object [ 'target_type' ] === 'comment' ) { // Get related entity. $ related_entity = $ this -> getActivityRelatedEntity ( $ data ) ; if ( ! empty ( $ related_entity [ 'target_id' ] ) && ! empty ( $ related_entity [ 'target_type' ] ) ) { $ query = \ Drupal :: database ( ) -> select ( 'comment_field_data' , 'cfd' ) ; $ query -> addExpression ( 'COUNT(DISTINCT cfd.uid)' ) ; $ query -> condition ( 'cfd.status' , 1 ) ; $ query -> condition ( 'cfd.entity_type' , $ related_entity [ 'target_type' ] ) ; $ query -> condition ( 'cfd.entity_id' , $ related_entity [ 'target_id' ] ) ; $ count = $ query -> execute ( ) -> fetchField ( ) ; } } return $ count ; }
Get unique authors number for activity aggregation.
Get unique authors number for activity aggregation .