Skip to content
Permalink
Browse files

remove usage of deprecated ``type()`` method

  • Loading branch information...
antograssiot committed Feb 22, 2016
1 parent 2c97741 commit d33aa5a7689595ff9d35d8a5dec37c2ec840d4aa
Showing with 7 additions and 7 deletions.
  1. +4 −4 src/Database/Query.php
  2. +3 −3 src/ORM/Behavior/TreeBehavior.php
@@ -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;
}
@@ -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);
}
@@ -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))

0 comments on commit d33aa5a

Please sign in to comment.
You can’t perform that action at this time.