<?php

namespace KupShop\I18nBundle\Translations;

use KupShop\I18nBundle\Util\TranslationCustomDataTrait;

class ProducersTranslation extends BaseTranslation implements TranslationCustomDataInterface
{
    use TranslationCustomDataTrait {
        getColumns as getColumnsTrait;
    }

    protected $columns = [
        'name' => ['alias' => 'Název', 'maxlength' => 100],
        'web' => ['alias' => 'Web', 'maxlength' => 250],
        'meta_title' => ['alias' => 'SEO název (title)', 'maxlength' => 70],
        'meta_description' => ['alias' => 'SEO popis (description)', 'maxlength' => 250],
        'meta_keywords' => ['alias' => 'Klíčová slova (keywords)', 'maxlength' => 100],
        'company_name' => ['alias' => 'V: Název společnosti', 'maxlength' => 250],
        'company_street' => ['alias' => 'V: Ulice', 'maxlength' => 100],
        'company_city' => ['alias' => 'V: Město', 'maxlength' => 50],
        'company_zip' => ['alias' => 'V: PSČ', 'maxlength' => 50],
        'company_country' => ['alias' => 'V: Země', 'maxlength' => 50],
        'company_email' => ['alias' => 'V: E-mail', 'maxlength' => 100],
        'company_web' => ['alias' => 'V: Web kontaktní', 'maxlength' => 100],
        'import_company_name' => ['alias' => 'D: Název společnosti', 'maxlength' => 250],
        'import_company_street' => ['alias' => 'D: Ulice', 'maxlength' => 100],
        'import_company_city' => ['alias' => 'D: Město', 'maxlength' => 50],
        'import_company_zip' => ['alias' => 'D: PSČ', 'maxlength' => 50],
        'import_company_country' => ['alias' => 'D: Země', 'maxlength' => 50],
        'import_company_email' => ['alias' => 'D: E-mail', 'maxlength' => 100],
        'import_company_web' => ['alias' => 'D: Web kontaktní', 'maxlength' => 100],
    ];

    protected $tableName = 'producers';

    protected $tableAlias = 'pr';

    protected $nameColumn = 'name';

    public function getColumns(): array
    {
        $columns = $this->getColumnsTrait();

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

        return $columns;
    }

    public bool $supportsHideNotTranslated = true;
}
