<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Payment.DirectDebitPaymentExtended StructType
 * @subpackage Structs
 */
class Payment_DirectDebitPaymentExtended extends Payment_DirectDebitPayment
{
    /**
     * The Paid
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var bool
     */
    public $Paid;
    /**
     * Constructor method for Payment.DirectDebitPaymentExtended
     * @uses Payment_DirectDebitPaymentExtended::setPaid()
     * @param bool $paid
     */
    public function __construct($paid = null)
    {
        $this
            ->setPaid($paid);
    }
    /**
     * Get Paid 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 bool|null
     */
    public function getPaid()
    {
        return isset($this->Paid) ? $this->Paid : null;
    }
    /**
     * Set Paid 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 bool $paid
     * @return \patest\StructType\Payment_DirectDebitPaymentExtended
     */
    public function setPaid($paid = null)
    {
        // validation for constraint: boolean
        if (!is_null($paid) && !is_bool($paid)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($paid, true), gettype($paid)), __LINE__);
        }
        if (is_null($paid) || (is_array($paid) && empty($paid))) {
            unset($this->Paid);
        } else {
            $this->Paid = $paid;
        }
        return $this;
    }
}
