public function DynamicLayout::setDefaultRowClass in Dynamic Layouts 8
Set the default row class.
Parameters
string $default_row_class: The default row class we need to set.
Overrides DynamicLayoutInterface::setDefaultRowClass
File
- src/
Entity/ DynamicLayout.php, line 119
Class
- DynamicLayout
- Defines the DynamicLayout entity.
Namespace
Drupal\dynamic_layouts\EntityCode
public function setDefaultRowClass($default_row_class) {
$this->default_row_class = $default_row_class;
// Loop over the rows and find the corresponding row number.
$rows = $this
->getRows();
if ($rows) {
foreach ($rows as $key => $row) {
$rows[$key][Constants::DEFAULT_ROW_CLASS] = $default_row_class;
}
}
$this->regions = serialize($rows);
}