function ViewsUiBaseViewsWizard::__construct

Overrides ViewsWizardInterface::__construct

File

plugins/views_wizard/views_ui_base_views_wizard.class.php, line 63

Class

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

Code

public 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;
        }
    }
}