LPH
Well-known member
This is the current code and need to figure out the correct way to grab the post_id after the save():
I tried $replier['post_id'] and see it is an object. This makes sense based on the var_dump / dump but now I'm uncertain how to get the post_id or if it is even possible.
Thank you for any suggestions.
PHP:
$visitor = \XF::visitor();
$message = $commentdata->comment_content;
if ( $thread_id !== false && $thread_id !== null && $visitor['is_banned'] != 1 ) {
$replier = \XF::app()->service('XF:Thread\Replier', $thread);
$replier->setMessage($message);
$replier->save();
$post_id = $replier;
}
I tried $replier['post_id'] and see it is an object. This makes sense based on the var_dump / dump but now I'm uncertain how to get the post_id or if it is even possible.
Code:
An exception occurred: [Error] Cannot use object of type XF\Service\Thread\Replier
Thank you for any suggestions.