<?php
namespace Products\NotificationsBundle\Form\Forms\Messages;
use App\Form\Forms\SearchForm;
use Products\NotificationsBundle\Model\Searching\MessageSearch;
use Symfony\Component\Form\Extension\Core\Type\SearchType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
final class MessageSearchForm extends SearchForm
{
protected const DATA_CLASS = MessageSearch::class;
/**
* {@inheritDoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
parent::buildForm($builder, $options);
$builder->add('lookup', SearchType::class, [
'required' => false,
'attr' => [
'placeholder' => 'Search messages...',
],
]);
}
/**
* {@inheritDoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
$resolver->setDefault('search_filters_label_format', 'app.notifications.messages.filters.%s');
}
}