You are here

public function MerciItemMigrateSource::__construct in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3

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

merci_migrate/merci_items.inc, line 60

Class

MerciItemMigrateSource

Code

public function __construct() {

  /*
      $merci_settings = db_query("SELECT * FROM {merci_node_type} mt INNER JOIN {node_type} nt ON mt.type = nt.type WHERE merci_type_setting <> :merci_type_setting", array(':merci_type_setting' => 'disabled'));

      $types = array();

      foreach ($merci_settings as $merci_setting) {
   $types[] = $merci_setting->type;
      }
  */
  $query = db_select('node', 'n')
    ->fields('n')
    ->condition('n.status', 1, '=');
  $query
    ->join('merci_node_type', 'mnt', 'n.type = mnt.type');
  $query
    ->condition('mnt.merci_type_setting', 'disabled', '<>');
  $query
    ->fields('mnt');
  parent::__construct($query);
}