ForwardStatistics.php in Forward 4.0.x        
                          
                  
                        
  
  
  
  
File
  src/Plugin/migrate/source/ForwardStatistics.php
  
    View source  
  <?php
namespace Drupal\forward\Plugin\migrate\source;
use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
class ForwardStatistics extends DrupalSqlBase {
  
  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;
  }
  
  public function fields() {
    return [
      'nid' => $this
        ->t('Primary key: the node ID.'),
      'type' => $this
        ->t('The node type or bundle.'),
      'last_forward_timestamp' => $this
        ->t('The date and time the node was last forwarded.'),
      'forward_count' => $this
        ->t('The number of times the node was forwarded.'),
      'clickthrough_count' => $this
        ->t('The number of times that the node was subsequently visited from a link in a forward email.'),
    ];
  }
  
  public function getIds() {
    $ids['nid']['type'] = 'integer';
    return $ids;
  }
}