Your IP : 216.73.216.220


Current Path : /home/rtorresani/www/vendor/magento/module-login-as-customer/Model/
Upload File :
Current File : //home/rtorresani/www/vendor/magento/module-login-as-customer/Model/SetLoggedAsCustomerAdminId.php

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Magento\LoginAsCustomer\Model;

use Magento\Customer\Model\Session;
use Magento\LoginAsCustomerApi\Api\SetLoggedAsCustomerAdminIdInterface;

/**
 * @inheritdoc
 *
 * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
 */
class SetLoggedAsCustomerAdminId implements SetLoggedAsCustomerAdminIdInterface
{
    /**
     * @var Session
     */
    private $session;

    /**
     * @param Session $session
     */
    public function __construct(Session $session)
    {
        $this->session = $session;
    }

    /**
     * @inheritdoc
     */
    public function execute(int $adminId): void
    {
        $this->session->setLoggedAsCustomerAdmindId($adminId);
    }
}