Repository navigation
2.2.0
Included commits: 2.1.2...2.2.0
Improvements
This release improves security of database models, generated by Propel. By default it is not active.
Deployment instructions:
- After updating to this version one should configure the new
QueryBuilderclass inconfig_propel.phpor any other configuration file extending the configuration:
$config[ApplicationConstants::PROPEL] = [
....
'generator' => [
....
'objectModel' => [
....
'builders' => [
....
'query' => '\Spryker\Zed\Propel\Business\Builder\QueryBuilder',
],
....
],
....
],
....
]
- Execute
vendor/console/bin propel:install - Check, that all query models were regenerated and
AmbiguousComparisonExceptionthrown in their code. This ensures, that filtering is not ambiguous and types match.
Technical details:
- QueryBuilder builds models in the way, that they now explicitly require specification of filtering criteria, when an array is passed as a filter value or one wants to use LIKE expression.
- If an ambiguous comparison is detected, a new exception
AmbiguousComparisonExceptionis thrown. - A new criterion
SprykerCriteria::BETWEENwas added to simplify filtering byminandmax. - Each model, built by the QueryBuilder, now has additional shortcut methods allowing to filter using IN, LIKE or BETWEEN criteria respectively, their names are:
filterBy<COLUMN_NAME>_In,filterBy<COLUMN_NAME>_LikeandfilterBy<COLUMN_NAME>_Betweenrespectively. - Behaviour of
PropelTypes::PHP_ARRAYcolumn types is not altered and still accepts LIKE-expressions.