bartko-s / stefano-tree

Framework agnostic Nested Set (MPTT) implementation for PHP
https://bartko-s.github.io/stefano-tree
BSD 3-Clause "New" or "Revised" License
28 stars 8 forks source link

Check the `left` property in order to check if a node is root or not #17

Closed silvadanilo closed 5 years ago

silvadanilo commented 5 years ago

In order to be able to use id (and so parentId) as string I would like to check the left property to discover if a node is root, because 0 == 'an-id-string' is true in php. Also the parentId can be null.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 97.992% when pulling 72e2f9f41b331c3a24ca4a1a89a81809ed4494e1 on silvadanilo:improved_is_root_method into adee3c27c29309b1ff635e56d0d29bde32105dd1 on bartko-s:master.

bartko-s commented 5 years ago

Thx @silvadanilo. New version 4.0.1 has been released.