<?php
{% set code %}
    {%- for field in fields %}

            ->add('{{ field }}')
    {%- endfor %}
{% endset %}

declare(strict_types=1);

namespace {{ namespace }};

use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;

final class {{ classBasename }} extends AbstractAdmin
{
    protected function configureDatagridFilters(DatagridMapper $datagridMapper): void
    {
        $datagridMapper
            {{- code }}
        ;
    }

    protected function configureListFields(ListMapper $listMapper): void
    {
        $listMapper
            {{- code }}
            ->add('_action', null, [
                'actions' => [
                    'show' => [],
                    'edit' => [],
                    'delete' => [],
                ],
            ])
        ;
    }

    protected function configureFormFields(FormMapper $formMapper): void
    {
        $formMapper
            {{- code }}
        ;
    }

    protected function configureShowFields(ShowMapper $showMapper): void
    {
        $showMapper
            {{- code }}
        ;
    }
}
