1.20.x layout_flexible.class.inc LayoutFlexibleTemplate::save()

Save a flexible layout template to config.

File

modules/layout/includes/layout_flexible.class.inc, line 82
Class that holds configuration for a flexible layout template configuration.

Class

LayoutFlexibleTemplate
@file Class that holds configuration for a flexible layout template configuration.

Code

function save() {
  $data = array(
    'name' => $this->name,
    'title' => $this->title,
    'description' => $this->description,
    'rows' => $this->rows,
  );

  config('layout.flexible.' . $this->name)
    ->setData($data)
    ->save();

  if (isset($this->is_new)) {
    unset($this->is_new);
  }

  layout_reset_caches();
  layout_flexible_reset_caches();
  backdrop_theme_rebuild();
}