Mario Estrada
Member
Hi,
We have extended XenForo_DataWriter_DiscussionMessage_Post with the class Techspot_DataWriter_DiscussionMessage_Post which has custom functionality for _messagePostSave and _messagePreSave.
Outside the XenForo environment we do something like this to save comments on news articles:
But when we instantiate the DataWriter this way it doesn't get extended with Techspot_DataWriter_DiscussionMessage_Post class. Is there anyway we can instantiate directly Techspot_DataWriter_DiscussionMessage_Post, when we try instantiating it directly the autoloader doesn't find XFCP_Techspot_DataWriter_DiscussionMessage_Post which is a class that's resolved dynamically when running inside XenForo.
We have extended XenForo_DataWriter_DiscussionMessage_Post with the class Techspot_DataWriter_DiscussionMessage_Post which has custom functionality for _messagePostSave and _messagePreSave.
Outside the XenForo environment we do something like this to save comments on news articles:
PHP:
$writer = XenForo_DataWriter::create('XenForo_DataWriter_DiscussionMessage_Post');
$writer->set('user_id', ...);
$writer->set('username', ...);
$writer->set('message', ...);
$writer->set('ip_id', ...);
$writer->set('thread_id', ...);
$writer->save();
But when we instantiate the DataWriter this way it doesn't get extended with Techspot_DataWriter_DiscussionMessage_Post class. Is there anyway we can instantiate directly Techspot_DataWriter_DiscussionMessage_Post, when we try instantiating it directly the autoloader doesn't find XFCP_Techspot_DataWriter_DiscussionMessage_Post which is a class that's resolved dynamically when running inside XenForo.