<?php

namespace Lycoreco\Apps\Admin\Controllers;

use Lycoreco\Apps\Recipes\Models\ReviewsModel;

class AdminReviewControler extends Abstract\AdminSingleController
{
    protected $model_сlass_name = "Lycoreco\Apps\Recipes\Models\ReviewsModel";
    protected $field_title = 'field_title';
    protected $verbose_name = 'review';
    protected $object_router_name = 'admin:review';

    protected $fields = array(
        [
            'model_field' => 'title',
            'input_type' => 'text',
            'input_attrs' => ['required']
        ],
        [
            'model_field' => 'rating',
            'input_type' => 'number',
            'input_attrs' => ['required']
        ], 
        [
            'model_field' => 'content',
            'input_type' => 'textarea',
            'input_attrs' => ['required']
        ],
        [
            'model_field' => 'status',
            'input_type' => 'select',
            'input_attrs' => ['required'],
            'input_values' => ReviewsModel::STATUS
        ],
        [
            'model_field' => 'created_at',
            'input_type' => 'text',
            'dynamic_save'  => false,
            'input_label' => 'Created at',
            'input_attrs' => ['disabled']
        ]
    );
}