You are here

public function D7FlagForList::query in Flag Lists 8

Same name and namespace in other branches
  1. 4.0.x src/Plugin/migrate/source/D7FlagForList.php \Drupal\flag_lists\Plugin\migrate\source\D7FlagForList::query()

Return value

\Drupal\Core\Database\Query\SelectInterface

Overrides SqlBase::query

File

src/Plugin/migrate/source/D7FlagForList.php, line 22

Class

D7FlagForList
Minimalistic example for a SqlBase source plugin.

Namespace

Drupal\flag_lists\Plugin\migrate\source

Code

public function query() {

  // Source data is queried from 'flag_lists_flags' table.
  $query = $this
    ->select('flag_lists_flags', 'c');
  $query
    ->join('flag', 'f', 'c.pfid = f.fid');
  $query
    ->fields('c', [
    'fid',
    'pfid',
    'uid',
    'entity_type',
    'options',
  ])
    ->fields('f', [
    'name',
    'title',
  ]);
  return $query;
}