$thread = Model_Thread::factory();
$thread->title = $form->validated('title');
$thread->slug = \Inflector::friendly_title($form->validated('title'), '-', true);
$thread->user_id = 1;
$thread->node_id = 2;
$thread->posts[] = Model_Post::factory(array(
'user_id' => 1,
'node_id' => 2,
'content' => $form->validated('content'),
));
$thread->save();
public function _event_after_save()
{
print_r('moo'); //is printed twice
}
It looks like you're new here. If you want to get involved, click one of these buttons!