本文整理汇总了PHP中XenForo_Visitor::toArray方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Visitor::toArray方法的具体用法?PHP XenForo_Visitor::toArray怎么用?PHP XenForo_Visitor::toArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Visitor
的用法示例。
在下文中一共展示了XenForo_Visitor::toArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insertNewPostWhenActionCreated
public function insertNewPostWhenActionCreated($teamId, $message, $systemPost = 0)
{
$visitor = $this->_visitor->toArray();
$teamModel = XenForo_Model::create('Nobita_Teams_Model_Team');
if (!($team = $teamModel->getTeamById($teamId))) {
throw new XenForo_Exception('[Nobita] Social Groups (Teams): Invalid team provided.', false);
return false;
}
$writer = XenForo_DataWriter::create('Nobita_Teams_DataWriter_Post');
$writer->bulkSet(array('team_id' => $team['team_id'], 'user_id' => $visitor['user_id'], 'username' => $visitor['username'], 'message' => $message, 'system_posting' => $systemPost));
$writer->save();
}
示例2: generateItemId
public function generateItemId($action, XenForo_Visitor $visitor, array $data)
{
$user = $visitor->toArray();
return strval($action) . '|' . $user['user_id'] . '|' . $this->generateHashForItemId($action, $user, $data) . (!empty($data) ? '|' . implode('|', array_map('strval', $data)) : '');
}