You are here

public function DynamicLayoutSettings::getLastColumnNumber in Dynamic Layouts 8

Get the first column number for a specific frontend library.

Parameters

string $frontend_library: The frontend library we need to get the first column class from.

string $new_column_prefix: The new column prefix.

string $new_grid_column_count: The new grid column count.

Overrides DynamicLayoutSettingsInterface::getLastColumnNumber

File

src/Entity/DynamicLayoutSettings.php, line 203

Class

DynamicLayoutSettings
Defines the DynamicLayoutSettings entity.

Namespace

Drupal\dynamic_layouts\Entity

Code

public function getLastColumnNumber($frontend_library, $new_column_prefix, $new_grid_column_count) {
  $last_column_class = '';

  // Get the column classes based on the chosen frontend library.
  switch ($frontend_library) {
    case 'custom':
      $column_classes = $this
        ->getCustomColumnClasses($new_grid_column_count);
      break;
    case Constants::BOOTSTRAP:
    default:
      $column_classes = $this
        ->getBootstrapColumnClasses();
      break;
  }
  if ($column_classes) {
    $last_column_class = end($column_classes);
  }
  return $last_column_class;
}