etrepat / baum

Baum is an implementation of the Nested Set pattern for Laravel's Eloquent ORM.
http://etrepat.com/baum
MIT License
2.24k stars 459 forks source link

$node->getLevel() eq $node->depth #259

Open AlexanderKharchenko opened 7 years ago

AlexanderKharchenko commented 7 years ago

$ Node->getLevel() when using this method, a lot of queries to the database.

When the whole tree, I replaced the $Node->getLevel() on $node->depth $Node->depth correctly return level?

When using $ Node->getLevel() -> database queries 471

When using $Node->depth -> database queries 5

Very important criterion