Aimeos\Shop\Base\Context::addUser PHP Method

addUser() protected method

Adds the user ID and name if available
protected addUser ( Aimeos\MShop\Context\Item\Iface $context ) : Aimeos\MShop\Context\Item\Iface
$context Aimeos\MShop\Context\Item\Iface Context object
return Aimeos\MShop\Context\Item\Iface Modified context object
    protected function addUser(\Aimeos\MShop\Context\Item\Iface $context)
    {
        if (($userid = Auth::id()) !== null) {
            $context->setUserId($userid);
        }
        if (($user = Auth::user()) !== null) {
            $context->setEditor($user->name);
        }
        return $context;
    }