HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/farmfun.komma.pro/app/Komma/Checkout/CheckoutService.php
<?php

namespace App\Komma\Checkout;

use App\Komma\Session\HasSessionTrait;

final class CheckoutService
{
    use HasSessionTrait;

    private $checkoutData;

    /** @var array The names of variables in this class to store and restore. */
    protected $variablesForSession = [
        'checkoutData',
    ];

    public function __construct()
    {
        $this->checkoutData = null;
        $this->restoreFromSession();
    }

    /**
     * @return |null
     */
    public function getCheckoutData()
    {
        $this->restoreFromSession();

        return $this->checkoutData;
    }

    /**
     * @param $checkoutData
     */
    public function setCheckoutData($checkoutData)
    {
        $this->checkoutData = $checkoutData;
        $this->saveSession();
    }

    /**
     * Clears session variables values.
     */
    public function clearCheckoutSession(): void
    {
        $this->clearSession();
    }
}