HQCoder
Member
in xf1 i can create a report with multi content with this code
but in xf i use the code
'
it show an error
is xf2 not support it???
PHP:
$reportContent = array(
"1" => array
(
"user_id" => '1',
"username" => 'user 1',
),
"2" => array
(
"user_id" => '2',
"username" => 'user 2',
),
"3" => array
(
"user_id" => '3',
"username" => 'user 3',
)
);
$reportModel = XenForo_Model::create('XenForo_Model_Report');
$reportModel->reportContent('spamer', $reportContent, $message);
but in xf i use the code
Code:
$reportContent = array(
"1" => array
(
"user_id" => '1',
"username" => 'user 1',
),
"2" => array
(
"user_id" => '2',
"username" => 'user 2',
),
"3" => array
(
"user_id" => '3',
"username" => 'user 3',
)
);
$creator = \XF::service('XF:Report\Creator', 'spamer', $reportContent);
$creator->setMessage($message);
$creator->save();
it show an error
ErrorException: [E_RECOVERABLE_ERROR] Argument 3 passed to XF\Service\Report\Creator::__construct() must be an instance of XF\Mvc\Entity\Entity, array given, called in \src\XF\Container.php on line 275 and defined src\XF\Service\Report\Creator.php:37
is xf2 not support it???