From e036bf98bf0945a1ec1656903e01ead56c5f0744 Mon Sep 17 00:00:00 2001 From: JaxxC Date: Fri, 9 Oct 2015 12:51:43 +0300 Subject: [PATCH] remove hardcoded column names 'parent_id' and 'position' change hardcoded column names 'parent_id' and 'position' to getParentIdColumn() and getPositionColumn() to prevent error on getTree() call with custom column names --- src/Franzose/ClosureTable/Models/Entity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Franzose/ClosureTable/Models/Entity.php b/src/Franzose/ClosureTable/Models/Entity.php index bed5e37..8cdeb6b 100644 --- a/src/Franzose/ClosureTable/Models/Entity.php +++ b/src/Franzose/ClosureTable/Models/Entity.php @@ -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(); }