1 layout_access.inc LayoutAccess::toArray()

Convert this object's properties to an array.

This is used to convert this handler's configuration to a storage-safe array, such as to be stored by the config management system as JSON.

Overrides LayoutHandler::toArray

File

core/modules/layout/plugins/access/layout_access.inc, line 130
Class for loading, modifying, and saving a layout access rule (condition).

Class

LayoutAccess
@file Class for loading, modifying, and saving a layout access rule (condition).

Code

function toArray() {
  $array = parent::toArray();
  // Don't save empty context settings.
  if (empty($array['settings']['contexts'])) {
    unset($array['settings']['contexts']);
  }
  return $array;
}