1 layout_context.inc LayoutContext::__construct($plugin_name, $config = array())

Constructor for LayoutContext objects.

Overrides LayoutHandler::__construct

File

core/modules/layout/plugins/context/layout_context.inc, line 173
Class that holds information relating to a layout's context.

Class

LayoutContext
@file Class that holds information relating to a layout's context.

Code

function __construct($plugin_name, $config = array()) {
  parent::__construct($plugin_name, $config);
  $this->plugin = $plugin_name;
  $properties = array(
    'required',
    'locked',
    'position',
    'name',
    'label',
    'storage',
    'usageType',
  );
  foreach ($properties as $property) {
    if (isset($config[$property])) {
      $this->$property = $config[$property];
    }
  }
}