Skip to content

Commit

Permalink
Merge pull request #25 from donquixote/issue-13-prep
Browse files Browse the repository at this point in the history
Issue #13: Let TableSection rely on ColumnClassesTrait.
  • Loading branch information
donquixote authored Oct 27, 2024
2 parents 20dc1dd + 8f43563 commit 113b88e
Showing 1 changed file with 3 additions and 34 deletions.
37 changes: 3 additions & 34 deletions src/TSection/TableSection.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Donquixote\Cellbrush\Axis\DynamicAxis;
use Donquixote\Cellbrush\BuildContainer\BuildContainer;
use Donquixote\Cellbrush\BuildContainer\BuildContainerBase;
use Donquixote\Cellbrush\Columns\ColumnClassesTrait;
use Donquixote\Cellbrush\Handle\RowHandle;
use Donquixote\Cellbrush\Handle\SectionColHandle;
use Donquixote\Cellbrush\Html\Multiple\DynamicAttributesMap;
Expand All @@ -14,7 +15,7 @@

class TableSection implements TableSectionInterface {

use MutableAttributesTrait;
use MutableAttributesTrait, ColumnClassesTrait;

/**
* @var string
Expand All @@ -37,13 +38,6 @@ class TableSection implements TableSectionInterface {
*/
private $rowStripings = array();

/**
* Column classes for this table section.
*
* @var DynamicAttributesMap
*/
private $colAttributes;

/**
* @var \Donquixote\Cellbrush\Cell\CellInterface[][]
* Format: $[$rowName][$colName] = $content
Expand Down Expand Up @@ -79,6 +73,7 @@ class TableSection implements TableSectionInterface {
*/
function __construct($tagName) {
$this->__constructMutableAttributes();
$this->__constructColumnClasses();
$this->tagName = $tagName;
$this->rows = new DynamicAxis();
$this->colAttributes = new DynamicAttributesMap();
Expand All @@ -95,32 +90,6 @@ public function colHandle($colName) {
return new SectionColHandle($this, $colName);
}

/**
* Adds a column class for this table section.
*
* @param string $colName
* @param string $class
*
* @return $this
*/
public function addColClass($colName, $class) {
$this->colAttributes->nameAddClass($colName, $class);
return $this;
}

/**
* Adds column classes for this table section.
*
* @param string[] $colClasses
* Format: $[$colName] = $class
*
* @return $this
*/
public function addColClasses(array $colClasses) {
$this->colAttributes->namesAddClasses($colClasses);
return $this;
}

/**
* @param string $rowName
*
Expand Down

0 comments on commit 113b88e

Please sign in to comment.