本文整理匯總了PHP中Thelia\Core\HttpFoundation\Request::toString方法的典型用法代碼示例。如果您正苦於以下問題:PHP Request::toString方法的具體用法?PHP Request::toString怎麽用?PHP Request::toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Thelia\Core\HttpFoundation\Request
的用法示例。
在下文中一共展示了Request::toString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: append
/**
* A simple helper to insert an entry in the admin log
*
* @param $resource
* @param $action
* @param $message
* @param Request $request
* @param UserInterface $adminUser
* @param bool $withRequestContent
*/
public static function append($resource, $action, $message, Request $request, UserInterface $adminUser = null, $withRequestContent = true)
{
$log = new AdminLog();
$log->setAdminLogin($adminUser !== null ? $adminUser->getUsername() : '<no login>')->setAdminFirstname($adminUser !== null && $adminUser instanceof Admin ? $adminUser->getFirstname() : '<no first name>')->setAdminLastname($adminUser !== null && $adminUser instanceof Admin ? $adminUser->getLastname() : '<no last name>')->setResource($resource)->setAction($action)->setMessage($message)->setRequest($request->toString($withRequestContent));
try {
$log->save();
} catch (\Exception $ex) {
Tlog::getInstance()->err("Failed to insert new entry in AdminLog: {ex}", array('ex' => $ex));
}
}