public function MigrateSourceView::__construct in Migrate 6.2
Simple initialization.
Parameters
SelectQueryInterface $query: The query we are iterating over.
array $fields: Optional - keys are field names, values are descriptions. Use to override the default descriptions, or to add additional source fields which the migration will add via other means (e.g., prepareRow()).
SelectQueryInterface $count_query: Optional - an explicit count query, primarily used when counting the primary query is slow.
boolean $options: Options applied to this source.
Overrides MigrateSourceSQL::__construct
File
- plugins/
sources/ view.inc, line 17 - Define a MigrateSource for importing from views
Class
- MigrateSourceView
- Implementation of MigrateSource, to handle imports from views. All that should be necessary (once Views is ported to D7) is to pull the SQL query from the view, the MigrateSourceSQL class can then just handle it like hand-constructed queries.
Code
public function __construct($view_name) {
$this->viewName = $view_name;
// TODO: Derive the query from the view
parent::__construct($query);
}