<?php

namespace Lycoreco\Apps\Admin\Controllers;


class IngredientRecipeRelListController extends Abstract\AdminListController
{
    protected $model_сlass_name = "Lycoreco\Apps\Recipes\Models\IngredientInRecipeModel";
    protected $table_fields = array(
        'Name' => 'ingredient_name',
        'Amount' => 'get_count()'
    );
    protected $single_router_name = 'admin:ing-cat-rel';
    protected $verbose_name = "ingredients in recipe";
    protected $verbose_name_multiply = "ingredients in recipe";

    public function custom_filter_fields()
    {
        $recipe_id = $this->url_context['url_1'];
        return array(
            [
                'name'  => 'obj.recipe_id',
                'type'  => '=',
                'value' => $recipe_id
            ]
        );
    }
}
