<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for CouponPaymentItem StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:CouponPaymentItem
 * @subpackage Structs
 */
class CouponPaymentItem extends AbstractPaymentItem
{
    /**
     * The CouponDetail
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\StructType\CouponDetail
     */
    public $CouponDetail;
    /**
     * Constructor method for CouponPaymentItem
     * @uses CouponPaymentItem::setCouponDetail()
     * @param \patest\StructType\CouponDetail $couponDetail
     */
    public function __construct(\patest\StructType\CouponDetail $couponDetail = null)
    {
        $this
            ->setCouponDetail($couponDetail);
    }
    /**
     * Get CouponDetail 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\CouponDetail|null
     */
    public function getCouponDetail()
    {
        return isset($this->CouponDetail) ? $this->CouponDetail : null;
    }
    /**
     * Set CouponDetail 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\CouponDetail $couponDetail
     * @return \patest\StructType\CouponPaymentItem
     */
    public function setCouponDetail(\patest\StructType\CouponDetail $couponDetail = null)
    {
        if (is_null($couponDetail) || (is_array($couponDetail) && empty($couponDetail))) {
            unset($this->CouponDetail);
        } else {
            $this->CouponDetail = $couponDetail;
        }
        return $this;
    }
}
