Skip to content

Commit

Permalink
Merge pull request #13109 from sergeyklay/3.2.x
Browse files Browse the repository at this point in the history
Removed no longer used "_with" parameter from the QueryBuilder
  • Loading branch information
sergeyklay authored Oct 3, 2017
2 parents 7e2032d + 4050859 commit 64b1841
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 25 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-3.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Fixed `Phalcon\Validation\Validator\File::validate` to work properly with parameter 'message' [#12947](https://github.com/phalcon/cphalcon/issues/12947)
- Fixed `Phalcon\Mvc\View::render` to render a view with params [#13046](https://github.com/phalcon/cphalcon/issues/13046)
- Fixed `Phalcon\Mvc\Model\Manager::getRelationRecords` to work properly with provided columns [#12972](https://github.com/phalcon/cphalcon/issues/12972)
- Mark as deprecated no longer used `Phalcon\Mvc\Model\Query\Builder::$_with` parameter [#13023](https://github.com/phalcon/cphalcon/issues/13023)

# [3.2.2](https://github.com/phalcon/cphalcon/releases/tag/v3.2.2) (2017-08-14)
- Fixed `Phalcon\Db\Adapter\Pdo\Postgresql::describeColumns` to work properly with `DOUBLE PRECISION` and `REAL` data types [#12842](https://github.com/phalcon/cphalcon/issues/12842)
Expand Down
36 changes: 13 additions & 23 deletions phalcon/mvc/model/query/builder.zep
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ class Builder implements BuilderInterface, InjectionAwareInterface

protected _joins;

/**
* @deprecated Will be removed in version 4.0.0
*/
protected _with;

protected _conditions;
Expand Down Expand Up @@ -107,7 +110,7 @@ class Builder implements BuilderInterface, InjectionAwareInterface
singleConditionArray, limit, offset, fromClause,
mergedConditions, mergedParams, mergedTypes,
singleCondition, singleParams, singleTypes,
with, distinct, bind, bindTypes;
distinct, bind, bindTypes;

if typeof params == "array" {

Expand Down Expand Up @@ -199,13 +202,6 @@ class Builder implements BuilderInterface, InjectionAwareInterface
let this->_joins = joinsClause;
}

/**
* Check if the resultset must be eager loaded
*/
if fetch with, params["with"] {
let this->_with = with;
}

/**
* Assign GROUP clause
*/
Expand Down Expand Up @@ -389,33 +385,27 @@ class Builder implements BuilderInterface, InjectionAwareInterface
/**
* Add a model to take part of the query
*
* NOTE: The third parameter $with is deprecated and will be removed in future releases.
*
*<code>
* // Load data from models Robots
* $builder->addFrom("Robots");
*
* // Load data from model 'Robots' using 'r' as alias in PHQL
* $builder->addFrom("Robots", "r");
*
* // Load data from model 'Robots' using 'r' as alias in PHQL
* // and eager load model 'RobotsParts'
* $builder->addFrom("Robots", "r", "RobotsParts");
*
* // Load data from model 'Robots' using 'r' as alias in PHQL
* // and eager load models 'RobotsParts' and 'Parts'
* $builder->addFrom(
* "Robots",
* "r",
* [
* "RobotsParts",
* "Parts",
* ]
* );
*</code>
*/
public function addFrom(var model, var alias = null, var with = null) -> <Builder>
{
var models, currentModel;

if typeof with != "null" {
trigger_error(
"The third parameter 'with' is deprecated and will be removed in future releases.",
E_DEPRECATED
);
}

let models = this->_models;
if typeof models != "array" {
if typeof models != "null" {
Expand Down
2 changes: 1 addition & 1 deletion tests/_support/Helper/Db/Connection/AbstractFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
abstract class AbstractFactory
{
/**
* Creates database connection
* Creates a database connection
*
* @return \Phalcon\Db\Adapter\Pdo
*/
Expand Down
1 change: 0 additions & 1 deletion tests/unit/Mvc/Model/MetaData/ResetCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Phalcon\Test\Unit\Mvc\Model\MetaData;

use Phalcon\Di;
use UnitTester;
use Phalcon\Mvc\Model;
use Codeception\Example;
Expand Down

0 comments on commit 64b1841

Please sign in to comment.