You are here

public function DynamicLayoutSettings::getGridColumnCount in Dynamic Layouts 8

Get the grid column count.

Overrides DynamicLayoutSettingsInterface::getGridColumnCount

1 call to DynamicLayoutSettings::getGridColumnCount()
DynamicLayoutSettings::getCustomColumnClasses in src/Entity/DynamicLayoutSettings.php

File

src/Entity/DynamicLayoutSettings.php, line 118

Class

DynamicLayoutSettings
Defines the DynamicLayoutSettings entity.

Namespace

Drupal\dynamic_layouts\Entity

Code

public function getGridColumnCount() {
  $settings = unserialize($this->settings);
  $column_count = NULL;

  // Check for grid column count from settings.
  if (isset($settings[Constants::GRID_COLUMN_COUNT])) {
    $column_count = $settings[Constants::GRID_COLUMN_COUNT];
  }

  // Default column count for bootstrap.
  if ($this
    ->getFrontendLibrary() == Constants::BOOTSTRAP) {
    $column_count = 12;
  }
  return $column_count;
}