本文整理匯總了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)) : '');
}