Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
KorsaR-ZN committed Aug 2, 2015
1 parent 1629efc commit 31bbbe4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions phalcon/mvc/model/criteria.zep
Original file line number Diff line number Diff line change
Expand Up @@ -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(<DiInterface> dependencyInjector, string! modelName, array! data) -> <Criteria>
public static function fromInput(<DiInterface> dependencyInjector, string! modelName, array! data, string! operator = "AND") -> <Criteria>
{
var attribute, conditions, field, value, type, metaData,
model, dataTypes, bind, criteria, columnMap;
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion phalcon/mvc/model/criteriainterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ interface CriteriaInterface
/**
* Builds a Phalcon\Mvc\Model\Criteria based on an input array like _POST
*/
public static function fromInput(<DiInterface> dependencyInjector, string! modelName, array! data) -> <CriteriaInterface>;
public static function fromInput(<DiInterface> dependencyInjector, string! modelName, array! data, string! operator = "AND") -> <CriteriaInterface>;

/**
* Executes a find using the parameters built with the criteria
Expand Down

0 comments on commit 31bbbe4

Please sign in to comment.