/** * Adds the user ID and name if available * * @param \MShop_Context_Item_Interface $context Context object */ protected function addUser(\MShop_Context_Item_Interface $context) { $username = ''; $context->setEditor($username); }
/** * Adds the user ID and name if available * * @param \MShop_Context_Item_Interface $context Context object */ protected function addUser(\MShop_Context_Item_Interface $context) { if (($userid = \Auth::id()) !== null) { $context->setUserId($userid); } if (($user = \Auth::user()) !== null) { $context->setEditor($user->name); } }