Skip to content

Commit

Permalink
[#14734] - Renamed cat methods to append
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed Feb 19, 2020
1 parent 295023f commit cfb33db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions phalcon/DataMapper/Query/AbstractConditions.zep
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ abstract class AbstractConditions extends AbstractQuery
*
* @return AbstractConditions
*/
public function catWhere(
public function appendWhere(
string condition,
var value = null,
int type = -1
) -> <AbstractConditions> {
this->catCondition("WHERE", condition, value, type);
this->appendCondition("WHERE", condition, value, type);

return this;
}
Expand Down Expand Up @@ -116,7 +116,7 @@ abstract class AbstractConditions extends AbstractQuery
var value = null,
int type = -1
) -> <AbstractConditions> {
this->appendCondition("WHERE", "OR ", condition, value, type);
this->addCondition("WHERE", "OR ", condition, value, type);

return this;
}
Expand All @@ -135,7 +135,7 @@ abstract class AbstractConditions extends AbstractQuery
var value = null,
int type = -1
) -> <AbstractConditions> {
this->appendCondition("WHERE", "AND ", condition, value, type);
this->addCondition("WHERE", "AND ", condition, value, type);

return this;
}
Expand Down Expand Up @@ -173,7 +173,7 @@ abstract class AbstractConditions extends AbstractQuery
* @param mixed|null $value
* @param int $type
*/
protected function appendCondition(
protected function addCondition(
string store,
string andor,
string condition,
Expand Down Expand Up @@ -315,7 +315,7 @@ abstract class AbstractConditions extends AbstractQuery
* @param mixed $value
* @param int $type
*/
protected function catCondition(
protected function appendCondition(
string store,
string condition,
var value = null,
Expand Down
6 changes: 3 additions & 3 deletions phalcon/DataMapper/Query/Select.zep
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class Select extends AbstractConditions
var value = null,
int type = -1
) -> <Select> {
this->catCondition("HAVING", condition, value, type);
this->appendCondition("HAVING", condition, value, type);

return this;
}
Expand Down Expand Up @@ -284,7 +284,7 @@ class Select extends AbstractConditions
var value = null,
int type = -1
) -> <Select> {
this->appendCondition("HAVING", "AND ", condition, value, type);
this->addCondition("HAVING", "AND ", condition, value, type);

return this;
}
Expand Down Expand Up @@ -349,7 +349,7 @@ class Select extends AbstractConditions
var value = null,
int type = -1
) -> <Select> {
this->appendCondition("HAVING", "OR ", condition, value, type);
this->addCondition("HAVING", "OR ", condition, value, type);

return this;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/database/DataMapper/Query/Select/WhereCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function dMQuerySelectWhereBind(DatabaseTester $I)
->where('inv_id > 1')
->andWhere('inv_total > :total')
->andWhere('inv_cst_id IN ', [1, 2, 3])
->catWhere(' AND inv_status_flag = ' . $select->bindInline(1))
->appendWhere(' AND inv_status_flag = ' . $select->bindInline(1))
->bindValue('total', 100)
;

Expand Down Expand Up @@ -102,7 +102,7 @@ public function dMQuerySelectOrWhereBind(DatabaseTester $I)

$select
->from('co_invoices')
->catWhere('inv_total > ', 100)
->appendWhere('inv_total > ', 100)
->orWhere("inv_status_flag = :status")
->bindValue('status', 1)
;
Expand Down

0 comments on commit cfb33db

Please sign in to comment.