Skip to content

Commit

Permalink
remove hardcoded column names 'parent_id' and 'position'
Browse files Browse the repository at this point in the history
change hardcoded column names 'parent_id' and 'position' to getParentIdColumn() and getPositionColumn() to prevent error on getTree() call with custom column names
  • Loading branch information
JaxxC committed Oct 9, 2015
1 parent 9449ddd commit e036bf9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Franzose/ClosureTable/Models/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ public static function getTree(array $columns = ['*'])
*/
$instance = new static;

return $instance->orderBy('parent_id')->orderBy('position')
return $instance->orderBy($instance->getParentIdColumn())->orderBy($instance->getPositionColumn())
->get($instance->prepareTreeQueryColumns($columns))->toTree();
}

Expand Down

0 comments on commit e036bf9

Please sign in to comment.