public function setCols($cols) { if (isset($cols['key'])) { $cols = [$cols]; } usort($cols, [$this, 'sort']); $this->cols = []; foreach ($cols as $c) { $c['key'] = strtolower($c['key']); $this->cols[] = $c; } return $this; }