Skip to content

Commit 04647cd

Browse files
author
David DiMaria
committed
Uses new static vars that replace the class constants
1 parent f08c42b commit 04647cd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/NestedSet.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Database\Connection;
66
use Illuminate\Database\Schema\Blueprint;
7+
use \Kalnoy\Nestedset\NodeTrait as Node;
78

89
class NestedSet {
910

@@ -15,9 +16,9 @@ class NestedSet {
1516
*/
1617
public static function columns(Blueprint $table, $primaryKey = 'id')
1718
{
18-
$table->unsignedInteger(Node::LFT);
19-
$table->unsignedInteger(Node::RGT);
20-
$table->unsignedInteger(Node::PARENT_ID)->nullable();
19+
$table->unsignedInteger(Node::$lft);
20+
$table->unsignedInteger(Node::$rgt);
21+
$table->unsignedInteger(Node::$parentId)->nullable();
2122

2223
$table->index(self::getDefaultColumns());
2324
}
@@ -42,7 +43,7 @@ public static function dropColumns(Blueprint $table)
4243
*/
4344
public static function getDefaultColumns()
4445
{
45-
return [ Node::LFT, Node::RGT, Node::PARENT_ID ];
46+
return [ Node::$lft, Node::$rgt, Node::$parentId ];
4647
}
4748

4849
}

0 commit comments

Comments
 (0)