<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace App\Form\Type\Admin;
use Sylius\Bundle\ResourceBundle\Form\Type\ResourceAutocompleteChoiceType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
final class FontAutoCompleteChoiceType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'resource' => 'app.font',
'choice_name' => 'name',
'choice_value' => 'id',
]);
}
/**
* {@inheritdoc}
*/
public function buildView(FormView $view, FormInterface $form, array $options): void
{
$view->vars['remote_criteria_type'] = 'contains';
$view->vars['remote_criteria_name'] = 'phrase';
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix(): string
{
return 'app_configurator_font_autocomplete_choice';
}
/**
* {@inheritdoc}
*/
public function getParent(): string
{
return ResourceAutocompleteChoiceType::class;
}
}