Skip to content

Commit

Permalink
Merge pull request #19967 from terabytesoftw/remove-deprecated-methods
Browse files Browse the repository at this point in the history
Remove deprecated methods to `QueryBuilder::class`.
  • Loading branch information
bizley authored Sep 22, 2023
2 parents 6b91860 + 751bea0 commit 62be1e6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 150 deletions.
139 changes: 0 additions & 139 deletions framework/db/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ class QueryBuilder extends \yii\base\BaseObject
*/
public $typeMap = [];

/**
* @var array map of query condition to builder methods.
* These methods are used by [[buildCondition]] to build SQL conditions from array syntax.
* @deprecated since 2.0.14. Is not used, will be dropped in 2.1.0.
*/
protected $conditionBuilders = [];
/**
* @var array map of condition aliases to condition classes. For example:
*
Expand Down Expand Up @@ -1611,139 +1605,6 @@ public function createConditionFromArray($condition)
return new HashCondition($condition);
}

/**
* Creates a condition based on column-value pairs.
* @param array $condition the condition specification.
* @param array $params the binding parameters to be populated
* @return string the generated SQL expression
* @deprecated since 2.0.14. Use `buildCondition()` instead.
*/
public function buildHashCondition($condition, &$params)
{
return $this->buildCondition(new HashCondition($condition), $params);
}

/**
* Connects two or more SQL expressions with the `AND` or `OR` operator.
* @param string $operator the operator to use for connecting the given operands
* @param array $operands the SQL expressions to connect.
* @param array $params the binding parameters to be populated
* @return string the generated SQL expression
* @deprecated since 2.0.14. Use `buildCondition()` instead.
*/
public function buildAndCondition($operator, $operands, &$params)
{
array_unshift($operands, $operator);
return $this->buildCondition($operands, $params);
}

/**
* Inverts an SQL expressions with `NOT` operator.
* @param string $operator the operator to use for connecting the given operands
* @param array $operands the SQL expressions to connect.
* @param array $params the binding parameters to be populated
* @return string the generated SQL expression
* @throws InvalidArgumentException if wrong number of operands have been given.
* @deprecated since 2.0.14. Use `buildCondition()` instead.
*/
public function buildNotCondition($operator, $operands, &$params)
{
array_unshift($operands, $operator);
return $this->buildCondition($operands, $params);
}

/**
* Creates an SQL expressions with the `BETWEEN` operator.
* @param string $operator the operator to use (e.g. `BETWEEN` or `NOT BETWEEN`)
* @param array $operands the first operand is the column name. The second and third operands
* describe the interval that column value should be in.
* @param array $params the binding parameters to be populated
* @return string the generated SQL expression
* @throws InvalidArgumentException if wrong number of operands have been given.
* @deprecated since 2.0.14. Use `buildCondition()` instead.
*/
public function buildBetweenCondition($operator, $operands, &$params)
{
array_unshift($operands, $operator);
return $this->buildCondition($operands, $params);
}

/**
* Creates an SQL expressions with the `IN` operator.
* @param string $operator the operator to use (e.g. `IN` or `NOT IN`)
* @param array $operands the first operand is the column name. If it is an array
* a composite IN condition will be generated.
* The second operand is an array of values that column value should be among.
* If it is an empty array the generated expression will be a `false` value if
* operator is `IN` and empty if operator is `NOT IN`.
* @param array $params the binding parameters to be populated
* @return string the generated SQL expression
* @throws Exception if wrong number of operands have been given.
* @deprecated since 2.0.14. Use `buildCondition()` instead.
*/
public function buildInCondition($operator, $operands, &$params)
{
array_unshift($operands, $operator);
return $this->buildCondition($operands, $params);
}

/**
* Creates an SQL expressions with the `LIKE` operator.
* @param string $operator the operator to use (e.g. `LIKE`, `NOT LIKE`, `OR LIKE` or `OR NOT LIKE`)
* @param array $operands an array of two or three operands
*
* - The first operand is the column name.
* - The second operand is a single value or an array of values that column value
* should be compared with. If it is an empty array the generated expression will
* be a `false` value if operator is `LIKE` or `OR LIKE`, and empty if operator
* is `NOT LIKE` or `OR NOT LIKE`.
* - An optional third operand can also be provided to specify how to escape special characters
* in the value(s). The operand should be an array of mappings from the special characters to their
* escaped counterparts. If this operand is not provided, a default escape mapping will be used.
* You may use `false` or an empty array to indicate the values are already escaped and no escape
* should be applied. Note that when using an escape mapping (or the third operand is not provided),
* the values will be automatically enclosed within a pair of percentage characters.
* @param array $params the binding parameters to be populated
* @return string the generated SQL expression
* @throws InvalidArgumentException if wrong number of operands have been given.
* @deprecated since 2.0.14. Use `buildCondition()` instead.
*/
public function buildLikeCondition($operator, $operands, &$params)
{
array_unshift($operands, $operator);
return $this->buildCondition($operands, $params);
}

/**
* Creates an SQL expressions with the `EXISTS` operator.
* @param string $operator the operator to use (e.g. `EXISTS` or `NOT EXISTS`)
* @param array $operands contains only one element which is a [[Query]] object representing the sub-query.
* @param array $params the binding parameters to be populated
* @return string the generated SQL expression
* @throws InvalidArgumentException if the operand is not a [[Query]] object.
* @deprecated since 2.0.14. Use `buildCondition()` instead.
*/
public function buildExistsCondition($operator, $operands, &$params)
{
array_unshift($operands, $operator);
return $this->buildCondition($operands, $params);
}

/**
* Creates an SQL expressions like `"column" operator value`.
* @param string $operator the operator to use. Anything could be used e.g. `>`, `<=`, etc.
* @param array $operands contains two column names.
* @param array $params the binding parameters to be populated
* @return string the generated SQL expression
* @throws InvalidArgumentException if wrong number of operands have been given.
* @deprecated since 2.0.14. Use `buildCondition()` instead.
*/
public function buildSimpleCondition($operator, $operands, &$params)
{
array_unshift($operands, $operator);
return $this->buildCondition($operands, $params);
}

/**
* Creates a SELECT EXISTS() SQL statement.
* @param string $rawSql the subquery in a raw form to select from.
Expand Down
11 changes: 0 additions & 11 deletions framework/db/mssql/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,17 +428,6 @@ protected function getAllColumnNames($modelClass = null)
return array_keys($schema->columns);
}

/**
* @return bool whether the version of the MSSQL being used is older than 2012.
* @throws \yii\base\InvalidConfigException
* @throws \yii\db\Exception
* @deprecated 2.0.14 Use [[Schema::getServerVersion]] with [[\version_compare()]].
*/
protected function isOldMssql()
{
return version_compare($this->db->getSchema()->getServerVersion(), '11', '<');
}

/**
* {@inheritdoc}
* @since 2.0.8
Expand Down

0 comments on commit 62be1e6

Please sign in to comment.