*/ class IntegerFilter { use FilterTrait; public function buildProperty(FormBuilderInterface $builder, FieldDto $fieldDto, $options = array()) { $builder->add( str_replace('.', '_', $fieldDto->getProperty()), IntegerType::class, array( 'required' => false, 'attr' => array( 'class' => ' input-sm', 'form' => 'filters-form', ), ) ); } public function applyFilter(QueryBuilder $queryBuilder, string $fieldProperty, string $filteredValue= null) { if ($filteredValue !== null) { $queryBuilder->andWhere( 'entity.'.$fieldProperty.' = :'.$fieldProperty.'' ); $queryBuilder->setParameter($fieldProperty, $filteredValue); } } }