Skip to content

Commit

Permalink
remove usage of deprecated type() method
Browse files Browse the repository at this point in the history
  • Loading branch information
antograssiot committed Feb 22, 2016
1 parent 2c97741 commit d33aa5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/Database/Query.php
Expand Up @@ -1430,11 +1430,11 @@ public function update($table)
public function set($key, $value = null, $types = [])
{
if (empty($this->_parts['set'])) {
$this->_parts['set'] = $this->newExpr()->type(',');
$this->_parts['set'] = $this->newExpr()->tieWith(',');
}

if ($this->_parts['set']->isCallable($key)) {
$exp = $this->newExpr()->type(',');
$exp = $this->newExpr()->tieWith(',');
$this->_parts['set']->add($key($exp));
return $this;
}
Expand Down Expand Up @@ -1811,11 +1811,11 @@ protected function _conjugate($part, $append, $conjunction, $types)
$append = $append($this->newExpr(), $this);
}

if ($expression->type() === $conjunction) {
if ($expression->tieWith() === $conjunction) {
$expression->add($append, $types);
} else {
$expression = $this->newExpr()
->type($conjunction)
->tieWith($conjunction)
->add([$append, $expression], $types);
}

Expand Down
6 changes: 3 additions & 3 deletions src/ORM/Behavior/TreeBehavior.php
Expand Up @@ -880,15 +880,15 @@ protected function _sync($shift, $dir, $conditions, $mark = false)
$exp = $query->newExpr();

$movement = clone $exp;
$movement ->add($field)->add("$shift")->type($dir);
$movement ->add($field)->add("$shift")->tieWith($dir);

$inverse = clone $exp;
$movement = $mark ?
$inverse->add($movement)->type('*')->add('-1'):
$inverse->add($movement)->tieWith('*')->add('-1'):
$movement;

$where = clone $exp;
$where->add($field)->add($conditions)->type('');
$where->add($field)->add($conditions)->tieWith('');

$query->update()
->set($exp->eq($field, $movement))
Expand Down

0 comments on commit d33aa5a

Please sign in to comment.