<?php

namespace KupShop\I18nBundle\Translations;

class ParametersListTranslation extends BaseTranslation
{
    protected $columns = [
        'value' => ['alias' => 'Hodnota', 'maxlength' => 150],
        'description' => ['alias' => 'Popis'],
    ];

    protected $tableName = 'parameters_list';

    protected $tableAlias = 'pl';

    protected $nameColumn = 'value';

    public function getForeignKeyColumn(): string
    {
        return 'id_'.$this->getTableName();
    }

    public function getColumns(): array
    {
        $columns = parent::getColumns();

        if (findModule(\Modules::INDEXED_FILTER)) {
            $columns = $columns + [
                'filter_url' => ['alias' => 'URL filtru', 'maxlength' => 50],
                'title' => ['alias' => 'Nadpis', 'maxlength' => 50],
            ];
        }

        return $columns;
    }
}
