Description
Hello Everybody!
I have 2 tables below:
vocabulary:
----id
----title
data example
id = 1; title = news
id = 2; title = products
id = 3; title = gallery
taxonomy:
----id
----vocabulary_id
----lft
----rgt
----depth
----title
----slug
...
with vocabulary_id = tree
I config behavior tree is vocabulary_id. But when I make root with function makeRoot() with follow:
$taxonomy = new Taxonomy([
'vocabulary_id' => 1, //news
'title' => 'News Cat A'
]);
$taxonomy->makeRoot();
I seen vocabulary_id = 1; lft = 1, rgt = 2, depth = 0, title = "News Cat A' ===> OK
but when I try with follow:
$taxonomy = new Taxonomy([
'vocabulary_id' => 3, //gallery
'title' => 'Gallery Cat A'
]);
$taxonomy->makeRoot();
I seen vocabulary_id = 2; lft = 1, rgt = 2, depth = 0, title = "Gallery Cat A' ===> Not good. Because I want vocabulary = 3