You are here

function ViewsUiBaseViewsWizard::__construct in Views (for Drupal 7) 7.3

Constructor.

Overrides ViewsWizardInterface::__construct

File

plugins/views_wizard/views_ui_base_views_wizard.class.php, line 63
Provides the interface and base class for Views Wizard plugins.

Class

ViewsUiBaseViewsWizard
A very generic Views Wizard class - can be constructed for any base table.

Code

function __construct($plugin) {
  $this->base_table = $plugin['base_table'];
  $default = $this->filter_defaults;
  if (isset($plugin['filters'])) {
    foreach ($plugin['filters'] as $name => $info) {
      $default['id'] = $name;
      $plugin['filters'][$name] = $info + $default;
    }
  }
  $this->plugin = $plugin;
  $entities = entity_get_info();
  foreach ($entities as $entity_type => $entity_info) {
    if (isset($entity_info['base table']) && $this->base_table == $entity_info['base table']) {
      $this->entity_info = $entity_info;
      $this->entity_type = $entity_type;
    }
  }
}