asprin
Active member
Just wondering what would be the recommended way of creating a category and forum so that it can used to created threads whenever a custom entity (say Foo) is inserted into the database? Does it go into the Setup file? Is there any sample code that I can look into for reference?
For example, when addon is installed, I would like to have a Category titled "Foo" created and under that a Forum titled "Newly added". This would give me a placeholder to put the threads created via code into these sections.
For example, when addon is installed, I would like to have a Category titled "Foo" created and under that a Forum titled "Newly added". This would give me a placeholder to put the threads created via code into these sections.
PHP:
$foo = $this->em()->create('Asprin\FB:Foo');
$foo->title = 'some short text here';
$foo->description = 'some long text here';
$foo->save();
// now that it's inserted, I want to go ahead and create a new thread under the Category/Forum that would have been created as part of addon