Skip to content

Commit

Permalink
Merge pull request #10751 from KorsaR-ZN/issues-10749
Browse files Browse the repository at this point in the history
[2.0.x] [NFR] \Mvc\Model\Criteria - fromImput #10749
  • Loading branch information
andresgutierrez committed Aug 3, 2015
2 parents 1629efc + b8244b9 commit 64ef70b
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)

This comment has been minimized.

Copy link
@ogarbe

ogarbe Aug 4, 2015

Contributor

typo ;)

This comment has been minimized.

Copy link
@ovr

ovr Aug 4, 2015

Contributor

http://semver.org/
PATCH version when you make backwards-compatible bug fixes.
It's BC, why you merge this?


# [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 64ef70b

Please sign in to comment.