<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Printing.PrintableItem.PaymentItemWithPaymentSession
 * StructType
 * @subpackage Structs
 */
class Printing_PrintableItem_PaymentItemWithPaymentSession extends Printing_PrintableItem_PaymentItemBase
{
    /**
     * The PaymentSession
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\StructType\Payment_Printing_PaymentSession
     */
    public $PaymentSession;
    /**
     * Constructor method for Printing.PrintableItem.PaymentItemWithPaymentSession
     * @uses Printing_PrintableItem_PaymentItemWithPaymentSession::setPaymentSession()
     * @param \patest\StructType\Payment_Printing_PaymentSession $paymentSession
     */
    public function __construct(\patest\StructType\Payment_Printing_PaymentSession $paymentSession = null)
    {
        $this
            ->setPaymentSession($paymentSession);
    }
    /**
     * Get PaymentSession value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return \patest\StructType\Payment_Printing_PaymentSession|null
     */
    public function getPaymentSession()
    {
        return isset($this->PaymentSession) ? $this->PaymentSession : null;
    }
    /**
     * Set PaymentSession value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param \patest\StructType\Payment_Printing_PaymentSession $paymentSession
     * @return \patest\StructType\Printing_PrintableItem_PaymentItemWithPaymentSession
     */
    public function setPaymentSession(\patest\StructType\Payment_Printing_PaymentSession $paymentSession = null)
    {
        if (is_null($paymentSession) || (is_array($paymentSession) && empty($paymentSession))) {
            unset($this->PaymentSession);
        } else {
            $this->PaymentSession = $paymentSession;
        }
        return $this;
    }
}
