public function init()
{
$attributes = [];
foreach ($this->attributes as $name => $attribute) {
if (!is_array($attribute)) {
$attributes[$attribute] = ['asc' => [$attribute => SORT_ASC], 'desc' => [$attribute => SORT_DESC]];
} elseif (!isset($attribute['asc'], $attribute['desc'])) {
$attributes[$name] = array_merge(['asc' => [$name => SORT_ASC], 'desc' => [$name => SORT_DESC]], $attribute);
} else {
$attributes[$name] = $attribute;
}
}
$this->attributes = $attributes;
}