- The
SearchOrdernow expects an associative array of field-names and direction. Passing aValuesGroupis deprecated, and will be removed in v3.0.
-
The
Rollerworks\Component\Search\Extension\Core\DataTransformer\IntegerToStringTransformerdeprecated usage of accepting anullvalue for$roundingMode, useIntegerToStringTransformer::ROUND_DOWNinstead. -
The
Rollerworks\Component\Search\Extension\Core\DataTransformer\NumberToLocalizedStringTransformerdeprecated usage of accepting anullvalue for$groupingand$roundingModeuseNumberToLocalizedStringTransformer::ROUND_DOWNfor$roundingModeandfalsefor$groupinginstead.
- Support for Api-Platform 2.4 was dropped, you need at least 4.2. Older beta packages can be used if support is required.
-
Passing
nullas type toConversionHints::createParamReferenceFor()is deprecated and will no longer be accepted in v3.0.0, pass a type name instead.For now passing
nulldefaults to "string", and might fail under specific conditions.
-
The Symfony Input Validator no longer validates a
PatternMatchvalue type. Set thepattern_match_constraintsoption to validate this specific type, with it's own constraints.Note: A PatternMatch will likely not contain a full value, for more advanced validating it's best to create your own input validator.
- Translation ids have been changed to better fit there context, see translation in "lib/Core/Resources/translations" for new ids.
-
Support for PHP < 8.1 was dropped.
-
Support for Symfony 5 was dropped.
-
Support for Api-Platform 2.4 was dropped, 2.0-BETA2 of the components still supports all newer versions of RollerworksSearch.
-
Support for using a query as string was removed, a DBAL QueryBuilder is now required to be passed to the generator.
-
The
DoctrineDbalFactory::createCachedConditionGenerator()method now requires a DBAL QueryBuilder and SearchCondition is provided instead of aConditionGeneratorinstance. -
The
ConditionGeneratornow longer provides access to the generated condition and parameters. These are applied automatically when callingapply().// Doctrine\DBAL\Query\QueryBuilder object $qb = $connection->createQueryBuilder(); // Rollerworks\Component\Search\SearchCondition object $searchCondition = ...; $conditionGenerator = $doctrineDbalFactory->createConditionGenerator($qb, $searchCondition); // Set fields mapping // .... // Apply the condition (with ordering, if any) to the QueryBuilder $conditionGenerator->apply(); // Get all the records // See http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/data-retrieval-and-manipulation.html#data-retrieval $result = $qb->execute();
- Doctrine mapping type as object is deprecated and will no longer work in 3.0, use a type-name as string instead.
-
Support for PHP < 7.4 was dropped.
-
Support for Symfony 4 was dropped.
-
Support for PHPUnit < 9.5 was dropped.
-
Support for Elastica 6 was dropped.
-
Support for Elasticsearch 6 was dropped.
See the upgrade instructions of Elasticsearch itself for more information.
- Support for passing a
Doctrine\ORM\Queryobject in the generators was removed, pass aDoctrine\ORM\QueryBuilderobject instead.
This BC change was required to make applying of result-ordering possible without worrying to much about details and edge-cases.
-
The methods
getWhereClause()andgetParameters()on the ConditionGenerators were removed. It's still possible to generate a stand-alone where-clause by using theDqlConditionGeneratordirectly, but this is not officially supported nor documented. -
The
createCachedConditionGeneratorofDoctrineOrmFactorynow expects a aQueryBuilderandSearchConditionare provided instead of a ConditionGenerator.Before:
$generator = $ormFactory->createConditionGenerator($query, $searchCondition); $generator = $ormFactory->createCachedConditionGenerator($generator, 60 * 60);
Now:
$generator = $ormFactory->createCachedConditionGenerator($query, $searchCondition, 60 * 60);
-
The
updateQuery()method on the ConditionGenerators was renamed toapply()and no longer supports a prepend for the query, as the query must now always be aQueryBuilder.
- The
html5option for theDateTimeTypehas been removed. Only the RFC3339 for the norm-input format is supported now.
- The
$forceNewargument inSearchConditionBuilder::field()is deprecated and will be removed in v2.0.0-BETA1, useoverwriteField()instead.
-
Support for SQLite was removed in Doctrine DBAL.
-
Values are no longer embedded but are now provided as parameters, make sure to bind these before executing the query.
Before:
$whereClause = $conditionGenerator->getWhereClause(); $statement = $connection->execute('SELECT * FROM tableName '.$whereClause); $rows = $statement->fetchAll(\PDO::FETCH_ASSOC);
Now:
$whereClause = $conditionGenerator->getWhereClause(); $statement = $connection->prepare('SELECT * FROM tableName '.$whereClause); $conditionGenerator->bindParameters($statement); $statement->execute(); $rows = $statement->fetchAll(\PDO::FETCH_ASSOC);
-
The
Rollerworks\Component\Search\Doctrine\Dbal\ValueConversion::convertValue()method now expects astringtype is returned, and requires a return-type. -
Conversion strategies was changed to return a different column/value statement rather than keeping all strategies cached.
Use the
ConversionHintnew parameters and helper method to determine the value for the Column.
-
Support for Doctrine ORM NativeQuery was removed, use the Doctrine DBAL condition-generator instead for this usage.
-
Values are no longer embedded but are now provided as parameters, make sure to bind these before executing the query.
Note: Using the
updateQuery()method already performs the binding process. -
Doctrine DBAL conversions are no longer applied, instead the Doctrine ORM integration now has it's own conversion API with a much more powerful integration.
Note: Any functions used in the conversion-generated DQL must be registered with the EntityManager configuration, refer to the Doctrine ORM manual for details.
-
The DataTransformers have been synchronized with the Symfony versions, which might cause some minor BC breakages.
- The
BaseNumberTransformerhas been removed, extend fromNumberToLocalizedStringTransformerinstead. - The
patternoption ofDateTimeTypenow only affects the view transformer, the norm transformer will use either theDateTimeToRfc3339TransformerorDateTimeToHtml5LocalDateTimeTransformerwhen thehtml5option is set to true. - The
precisionoption of theNumberTypehas been renamed toscale. - The
IntegerTypeno longer accepts float values.
- The
-
The ArrayInput processor has been removed.
-
ApiPlatform SearchConditionListener no longer supports array-input. Use JSON or the NormStringQuery input-format instead.
-
The default restriction values of
ProcessorConfighave been changed to provide a better default;- Maximum values per field is now 100 (was 1000)
- Maximum number of groups is now 10 (was 100)
- Nesting is now 5 (was 100)
Unless you must support a higher number of values it is advised to not increase these values.
-
The ConditionOptimizers have been removed.
-
The XmlInput processor has been removed.
-
The SearchProcessor Component has been removed, use an InputProcessor directly.
Before:
$inputProcessorLoader = Loader\InputProcessorLoader::create(); $conditionExporterLoader = Loader\ConditionExporterLoader::create(); $processor = new Psr7SearchProcessor($searchFactory, $inputProcessorLoader, $conditionExporterLoader); $request = ...; // A PSR-7 ServerRequestInterface object instance $processorConfig = new ProcessorConfig($userFieldSet); $searchPayload = $processor->processRequest($request, $processorConfig); if ($searchPayload->isChanged() && $searchPayload->isValid()) { header('Location: /search?search='.$searchPayload->searchCode); exit(); } if (!$payload->isValid()) { foreach ($payload->messages as $error) { echo (string) $error.PHP_EOL; } } // Notice: This is null when there are errors, when the condition is valid but has // no fields/values this is an empty SearchCondition object. $condition = $payload->searchCondition;
After:
// ... $inputProcessor = new StringQueryInput(); // Can be wrapped in a CachingInputProcessor $processorConfig = new ProcessorConfig($fieldSet); $request = ...; // A PSR-7 ServerRequestInterface object instance try { if ($request->getMethod() === 'POST') { $query = $request->getQueryParams()['search'] ?? ''; header('Location: /search?search='.$searchPayload->searchCode); exit(); // return new RedirectResponse($request->getRequestUri().'?search='.$query); } $query = $request->getParsedBody()['search'] ?? ''; $condition = $inputProcessor->process($processorConfig, $query); // Use condition } catch (InvalidSearchConditionException $e) { foreach ($e->getErrors() as $error) { echo (string) $error.PHP_EOL; } }
Note: The ArrayInput processor has been removed, only string-type input formats (StringInput and JsonInput) are supported now.
-
The
ApiSearchProcessorhas been removed. Internally theSearchConditionListenernow handles the user-input and error handling. -
The
SearchConditionListenerconstructor has changed:Before:
SearchFactory $searchFactory SearchProcessor $searchProcessor UrlGeneratorInterface $urlGenerator ResourceMetadataFactory $resourceMetadataFactory EventDispatcherInterface $eventDispatcherAfter:
SearchFactory $searchFactory InputProcessorLoader $inputProcessorLoader ResourceMetadataFactory $resourceMetadataFactory EventDispatcherInterface $eventDispatcher CacheInterface $cache = nullNote: The
$cacheargument is optional and only used when the$cacheTTLof theProcessorConfigis configured. -
Cache TTL configuration has been moved to
Rollerworks\Component\Search\Input\ProcessorConfig, the metadata configuration format has remained unchanged. -
The Input format is now automatically detected by the first character. When the provided input starts with an
{theJsonInputprocessor is used, otherwise theNormStringQueryInputprocessor is used. -
ArrayInput is deprecated and is internally delegated to the JsonInputProcessor.
In RollerworksSearch v2.0.0-ALPHA12 support for ArrayInput is completely removed and will throw an exception instead.
- The
Rollerworks\Component\Search\ApiPlatform\EventListener\SearchConditionListenernow requires anEventDispatchInterfaceinstance as last argument.
- The
Rollerworks\Component\Search\Doctrine\Dbal\StrategySupportedConversion::getConversionStrategymethod must now return an integer (and is enforced with a return-type).
-
Support for using Regex in ValueMatch has been removed.
-
The constants
PatternMatch::PATTERN_REGEXandPatternMatch::PATTERN_NOT_REGEXhave been removed. -
The method
PatternMatch::isRegexhas been removed.
-
-
The
ValueComparisonnamespaces and classes have been renamed toValueComparator -
The
FieldConfig::setValueComparisonmethod has been renamed tosetValueComparator -
The
FieldConfig::getValueComparisonmethod has been renamed togetValueComparator