3 namespace Drupal\migrate_example\Plugin\migrate\source;
5 use Drupal\migrate\Plugin\migrate\source\SqlBase;
8 * Source plugin for beer comments.
14 class BeerComment extends SqlBase {
19 public function query() {
20 $query = $this->select('migrate_example_beer_comment', 'mec')
21 ->fields('mec', ['cid', 'cid_parent', 'name', 'mail', 'aid',
22 'body', 'bid', 'subject'])
23 ->orderBy('cid_parent', 'ASC');
30 public function fields() {
32 'cid' => $this->t('Comment ID'),
33 'cid_parent' => $this->t('Parent comment ID in case of comment replies'),
34 'name' => $this->t('Comment name (if anon)'),
35 'mail' => $this->t('Comment email (if anon)'),
36 'aid' => $this->t('Account ID (if any)'),
37 'bid' => $this->t('Beer ID that is being commented upon'),
38 'subject' => $this->t('Comment subject'),
47 public function getIds() {