Commit 9fc9f6f8 authored by dawehner's avatar dawehner Committed by tim.plunkett

Issue #1760380 by dawehner: Improve docs/code of the wizard constructor.

parent 69060eca
......@@ -12,7 +12,13 @@
*/
interface WizardInterface {
function __construct($plugin);
/**
* Constructs a wizard plugin object.
*
* @param array $definition
* The information stored in the annotation definition.
*/
function __construct(array $definition);
/**
* For AJAX callbacks to build other elements in the "show" form.
......
......@@ -116,14 +116,15 @@ abstract class WizardPluginBase implements WizardInterface {
/**
* Constructs the WizardPluginBase object.
*
* @param array $plugin
* The plugin information array.
* @param array $definition
* The information stored in the annotation definition.
*/
function __construct($plugin) {
$this->base_table = $plugin['base_table'];
$default = $this->filter_defaults;
function __construct(array $definition) {
$this->base_table = $definition['base_table'];
$this->plugin = $plugin;
// @todo: Move plugin to definition to keep it consistent with the rest of
// views.
$this->plugin = $definition;
$entities = entity_get_info();
foreach ($entities as $entity_type => $entity_info) {
......@@ -176,6 +177,8 @@ public function getPathFieldsSupplemental() {
public function getFilters() {
$filters = array();
$default = $this->filter_defaults;
foreach ($this->filters as $name => $info) {
$default['id'] = $name;
$filters[$name] = $info + $default;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment