diff --git a/CHANGELOG.md b/CHANGELOG.md index 5892def2b75..e8cd8ddc0e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Fixed Session\Bag::remove() - Session\Bag::destroy() eliminates any temporary data in the variables bag - afterCreate/afterUpdate are only called if saving related records was successful +- Added parameter the changing concatenation conditions in method `Mvc\Model\Criteria::fromImput()` [#10749](https://github.com/phalcon/cphalcon/issues/10749) # [2.0.6](https://github.com/phalcon/cphalcon/releases/tag/phalcon-v2.0.6) (2015-07-21) - Builds in TravisCI now uses Docker to perform faster builds diff --git a/phalcon/mvc/model/criteria.zep b/phalcon/mvc/model/criteria.zep index c1e49aff785..c4a8a767560 100644 --- a/phalcon/mvc/model/criteria.zep +++ b/phalcon/mvc/model/criteria.zep @@ -685,7 +685,7 @@ class Criteria implements CriteriaInterface, InjectionAwareInterface /** * Builds a Phalcon\Mvc\Model\Criteria based on an input array like _POST */ - public static function fromInput( dependencyInjector, string! modelName, array! data) -> + public static function fromInput( dependencyInjector, string! modelName, array! data, string! operator = "AND") -> { var attribute, conditions, field, value, type, metaData, model, dataTypes, bind, criteria, columnMap; @@ -736,7 +736,7 @@ class Criteria implements CriteriaInterface, InjectionAwareInterface */ let criteria = new self(); if count(conditions) { - criteria->where(join(" AND ", conditions)); + criteria->where(join(" " + operator + " ", conditions)); criteria->bind(bind); } diff --git a/phalcon/mvc/model/criteriainterface.zep b/phalcon/mvc/model/criteriainterface.zep index 180d5fa87cd..ad5377ed4ed 100644 --- a/phalcon/mvc/model/criteriainterface.zep +++ b/phalcon/mvc/model/criteriainterface.zep @@ -192,7 +192,7 @@ interface CriteriaInterface /** * Builds a Phalcon\Mvc\Model\Criteria based on an input array like _POST */ - public static function fromInput( dependencyInjector, string! modelName, array! data) -> ; + public static function fromInput( dependencyInjector, string! modelName, array! data, string! operator = "AND") -> ; /** * Executes a find using the parameters built with the criteria