You are here

function crumbs_UI_TableColumns::addColGroup in Crumbs, the Breadcrumbs suite 7.2

Parameters

string $groupName:

string[] $colNameSuffixes:

Throws

Exception

File

lib/UI/TableColumns.php, line 48

Class

crumbs_UI_TableColumns

Code

function addColGroup($groupName, array $colNameSuffixes) {
  if (empty($colNameSuffixes)) {
    throw new Exception("Suffixes cannot be empty.");
  }
  foreach ($colNameSuffixes as $colNameSuffix) {
    $colName = $groupName . '.' . $colNameSuffix;
    if (isset($this->cols[$colName])) {
      throw new Exception("Column '{$colName}' already exists.");
    }
    $this->cols[$colName] = $groupName;
  }
  $this->colGroups[$groupName] = $colNameSuffixes;
}