You are here

public function ForwardStatistics::query in Forward 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/migrate/source/ForwardStatistics.php \Drupal\forward\Plugin\migrate\source\ForwardStatistics::query()
  2. 8.2 src/Plugin/migrate/source/ForwardStatistics.php \Drupal\forward\Plugin\migrate\source\ForwardStatistics::query()
  3. 4.x src/Plugin/migrate/source/ForwardStatistics.php \Drupal\forward\Plugin\migrate\source\ForwardStatistics::query()
  4. 4.0.x src/Plugin/migrate/source/ForwardStatistics.php \Drupal\forward\Plugin\migrate\source\ForwardStatistics::query()

Return value

\Drupal\Core\Database\Query\SelectInterface

Overrides SqlBase::query

File

src/Plugin/migrate/source/ForwardStatistics.php, line 19

Class

ForwardStatistics
Forward statistics source.

Namespace

Drupal\forward\Plugin\migrate\source

Code

public function query() {
  $query = $this
    ->select('forward_statistics', 'f');
  $query
    ->join('node', 'n', 'f.nid = n.nid');
  $query = $query
    ->fields('f', [
    'nid',
    'last_forward_timestamp',
    'forward_count',
    'clickthrough_count',
  ])
    ->fields('n', [
    'type',
  ])
    ->orderBy('nid');
  return $query;
}