<?php

return [
    "type"           => "result_entity",
    "model"          => App\Models\ResultEntity::class,
    "label"          => "content_types.result_entity_plural",
    "label_singular" => "content_types.result_entity_singular",
    "hierarchic"     => FALSE,
    "group"          => "none",
    "parent" => array(
        "field"         => "result_winner_id",
        "contentType"   => "result_winner"
    ),
    "search"         => [
        "title" => "title",
        "fields" => [
            "title",
            "name"
        ],
        "relations" => [
            "authors",
            "contributors"
        ],
    ],
    "fields"         => [
        [
            "name"          => "title",
            "label"         => "content_types.result_entity_title",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|max:255",
            "inList"        => TRUE,
            "search"        => TRUE,
            "sort"          => TRUE
        ],
        [
            "name"          => "name",
            "label"         => "content_types.winner_name",
            "type"          => "textBox",
            "maxLength"     => 255,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "required|max:255",
        ],
        [
            "name"          => "company_profile_id",
            "label"         => "content_types.company",
            "type"          => "selectBox",
            "selectModel"   => [
                "endpoint" => 'content/company-profiles/auto-complete',
            ],
            "preValidation" => "trim",
            "inList"        => TRUE,
            "search"        => TRUE,
            "sort"          => TRUE,
        ],
        [
            "name" => "authors",
            "label" => "content_types.authors",
            "type" => "repeater",
            "objectType" => "result_author",
            "order" => true
        ],
        [
            "name" => "contributors",
            "label" => "content_types.contributors",
            "type" => "repeater",
            "objectType" => "result_contributor",
            "order" => true,
        ],
        /* [
            "name"          => "content",
            "label"         => "Content",
            "type"          => "textArea",
            "multiLanguage" => FALSE,
            "preValidation" => "xss_clean|trim",
        ], */
    ],
    "actions"        => [
        "insert", "edit", "delete", "order"
    ]
];
