• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Lack of interest Node Datawriters

xf_phantom

Well-known member
#1
It would be nice, if the node_type_id would be set automatically by the forum/page/category/linkforum/etc... datawriter, so we don't have to set this field when using the forum/page/category/linkforum datawriter.

PHP:
/** @var XenForo_DataWriter_Forum $nodeDw */
         $nodeDw = XenForo_DataWriter::create('XenForo_DataWriter_Forum');
         $nodeDw->set('title', $faker->forumTitle);
// why do i need the following line?
// i'm already using the forum datawriter, he should handle this for me
         $nodeDw->set('node_type_id', 'Forum');
         $nodeDw->save();
 
Last edited:

Marcus

Well-known member
#2
Actually that is why there are different datawriters :) Of course it's usefult to auto-populate all unchangeable input from the writer.