<?php

namespace App\Models\Objects;

use App\Models\Objects\Values\BooleanValue;
use App\Models\Objects\Values\DatetimeValue;
use App\Models\Objects\Values\DateValue;
use App\Models\Objects\Values\DocumentValue;
use App\Models\Objects\Values\FloatValue;
use App\Models\Objects\Values\HtmlValue;
use App\Models\Objects\Values\ImageValue;
use App\Models\Objects\Values\IntegerValue;
use App\Models\Objects\Values\RelationValue;
use App\Models\Objects\Values\StringValue;
use App\Models\Objects\Values\TextValue;
use App\Models\Objects\Values\TimeValue;

class FieldType {
    public const STRING = 'string';
    public const TEXT = 'text';
    public const HTML = 'html';
    public const INTEGER = 'integer';
    public const FLOAT = 'float';
    public const BOOLEAN = 'boolean';
    public const DATE = 'date';
    public const TIME = 'time';
    public const DATETIME = 'datetime';
    public const RELATION = 'relation';
    public const DOCUMENT = 'document';
    public const IMAGE = 'image';

    public const TITLES = [
        self::STRING => 'Строка',
        self::TEXT => 'Текст',
        self::HTML => 'Текст с разметкой',
        self::INTEGER => 'Целое число',
        self::FLOAT => 'Число с точкой',
        self::BOOLEAN => 'Двоичное',
        self::DATE => 'Дата',
        self::TIME => 'Время',
        self::DATETIME => 'Дата и время',
        self::RELATION => 'Отношение',
        self::DOCUMENT => 'Документ',
        self::IMAGE => 'Изображение'
    ];

    public const TABLES = [
        self::STRING => 'field_string_values',
        self::TEXT => 'field_text_values',
        self::HTML => 'field_html_values',
        self::INTEGER => 'field_integer_values',
        self::FLOAT => 'field_float_values',
        self::BOOLEAN => 'field_boolean_values',
        self::DATE => 'field_date_values',
        self::TIME => 'field_time_values',
        self::DATETIME => 'field_datetime_values',
        self::RELATION => 'field_relation_values',
        self::DOCUMENT => 'field_document_values',
        self::IMAGE => 'field_image_values'
    ];

    public const CLASSES = [
        self::STRING => StringValue::class,
        self::TEXT => TextValue::class,
        self::HTML => HtmlValue::class,
        self::INTEGER => IntegerValue::class,
        self::FLOAT => FloatValue::class,
        self::BOOLEAN => BooleanValue::class,
        self::DATE => DateValue::class,
        self::TIME => TimeValue::class,
        self::DATETIME => DatetimeValue::class,
        self::RELATION => RelationValue::class,
        self::DOCUMENT => DocumentValue::class,
        self::IMAGE => ImageValue::class
    ];
}