Skip to content

Commit

Permalink
Fix for exception due to not defined variables
Browse files Browse the repository at this point in the history
  • Loading branch information
David Meyers committed Mar 30, 2014
1 parent 58780a9 commit abf7a98
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Franzose/ClosureTable/Models/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -1312,9 +1312,11 @@ protected function reorderSiblings($parentIdChanged = false)
$query = $this->siblings();
}

$query->buildWherePosition($positionColumn, $range)
->where($this->getKeyName(), '<>', $this->getKey())
->$action($positionColumn);
if($action) {
$query->buildWherePosition($positionColumn, $range)
->where($this->getKeyName(), '<>', $this->getKey())
->$action($positionColumn);
}
}
}

Expand All @@ -1330,6 +1332,7 @@ protected function reorderSiblings($parentIdChanged = false)
*/
protected function setupReordering($parentIdChanged)
{
$range = $action = null;
// If the model's parent was changed, firstly we decrement
// positions of the 'old' next siblings of the model.
if ($parentIdChanged === true)
Expand Down Expand Up @@ -1445,4 +1448,4 @@ protected function newBaseQueryBuilder()

return new QueryBuilder($conn, $grammar, $conn->getPostProcessor());
}
}
}

0 comments on commit abf7a98

Please sign in to comment.