You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
You can't set treeAttribute, leftAttribute, rightAttribute to custom values. They restricted by design. Due to NS nature treeAttribute should be equal to id so you can't use treeAttribute as FK for another table. I think in your case its good idea to add additional field.
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
The text was updated successfully, but these errors were encountered: