for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?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.
*/
namespace Sylius\Bundle\ProductBundle\Form\Type;
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;
/**
* @author Łukasz Chruściel <[email protected]>
final class ProductAutocompleteChoiceType extends AbstractType
{
* {@inheritdoc}
public function configureOptions(OptionsResolver $resolver)
$resolver->setDefaults([
'resource' => 'sylius.product',
'choice_name' => 'name',
'choice_value' => 'code',
]);
}
public function buildView(FormView $view, FormInterface $form, array $options)
$view->vars['remote_criteria_type'] = 'contains';
$view->vars['remote_criteria_name'] = 'phrase';
public function getBlockPrefix()
return 'sylius_product_autocomplete_choice';
public function getParent()
return ResourceAutocompleteChoiceType::class;