Because Categories are not in a relationship with Snippets that way. A Snippet is related to one single Category. So you could add a single Category with addOne() to a Snippet. If you add multiple Categories to a single Snippet, the Snippet would have to choose which one of the many it should be related to...
-
- 62 Posts
yeah. copy paste typo. [tt]$snippet->addOne($category);[/tt] doesn’t work for me actually.
First, why not collect all your Snippets into an array and do $category->addMany($snippets) all at once, rather than one Snippet at a time?
Second, I don’t see the call in question to $snippet->addOne($category)? Isn’t that what we were discussing?
-
- 62 Posts
Yeah I did’t upload the non-working build script. But you see the difference between the addOne build script and the addMany one in the video which is now available.
-
- 62 Posts
I sent it to modx at opengeek dot com. I hope you can help me.
thanks,
JB