<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Printing.PrintableItem.DonationBase StructType
 * @subpackage Structs
 */
class Printing_PrintableItem_DonationBase extends Printing_PrintableItem_BasketItemBase
{
    /**
     * The GiftType
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $GiftType;
    /**
     * The IsAnonymous
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var bool
     */
    public $IsAnonymous;
    /**
     * The IsPrintSpecialClientName
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var bool
     */
    public $IsPrintSpecialClientName;
    /**
     * The NameOnDonation
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $NameOnDonation;
    /**
     * Constructor method for Printing.PrintableItem.DonationBase
     * @uses Printing_PrintableItem_DonationBase::setGiftType()
     * @uses Printing_PrintableItem_DonationBase::setIsAnonymous()
     * @uses Printing_PrintableItem_DonationBase::setIsPrintSpecialClientName()
     * @uses Printing_PrintableItem_DonationBase::setNameOnDonation()
     * @param string $giftType
     * @param bool $isAnonymous
     * @param bool $isPrintSpecialClientName
     * @param string $nameOnDonation
     */
    public function __construct($giftType = null, $isAnonymous = null, $isPrintSpecialClientName = null, $nameOnDonation = null)
    {
        $this
            ->setGiftType($giftType)
            ->setIsAnonymous($isAnonymous)
            ->setIsPrintSpecialClientName($isPrintSpecialClientName)
            ->setNameOnDonation($nameOnDonation);
    }
    /**
     * Get GiftType 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 string|null
     */
    public function getGiftType()
    {
        return isset($this->GiftType) ? $this->GiftType : null;
    }
    /**
     * Set GiftType 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
     * @uses \patest\EnumType\GiftType::valueIsValid()
     * @uses \patest\EnumType\GiftType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $giftType
     * @return \patest\StructType\Printing_PrintableItem_DonationBase
     */
    public function setGiftType($giftType = null)
    {
        // validation for constraint: enumeration
        if (!\patest\EnumType\GiftType::valueIsValid($giftType)) {
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \patest\EnumType\GiftType', is_array($giftType) ? implode(', ', $giftType) : var_export($giftType, true), implode(', ', \patest\EnumType\GiftType::getValidValues())), __LINE__);
        }
        if (is_null($giftType) || (is_array($giftType) && empty($giftType))) {
            unset($this->GiftType);
        } else {
            $this->GiftType = $giftType;
        }
        return $this;
    }
    /**
     * Get IsAnonymous 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 getIsAnonymous()
    {
        return isset($this->IsAnonymous) ? $this->IsAnonymous : null;
    }
    /**
     * Set IsAnonymous 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 $isAnonymous
     * @return \patest\StructType\Printing_PrintableItem_DonationBase
     */
    public function setIsAnonymous($isAnonymous = null)
    {
        // validation for constraint: boolean
        if (!is_null($isAnonymous) && !is_bool($isAnonymous)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($isAnonymous, true), gettype($isAnonymous)), __LINE__);
        }
        if (is_null($isAnonymous) || (is_array($isAnonymous) && empty($isAnonymous))) {
            unset($this->IsAnonymous);
        } else {
            $this->IsAnonymous = $isAnonymous;
        }
        return $this;
    }
    /**
     * Get IsPrintSpecialClientName 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 getIsPrintSpecialClientName()
    {
        return isset($this->IsPrintSpecialClientName) ? $this->IsPrintSpecialClientName : null;
    }
    /**
     * Set IsPrintSpecialClientName 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 $isPrintSpecialClientName
     * @return \patest\StructType\Printing_PrintableItem_DonationBase
     */
    public function setIsPrintSpecialClientName($isPrintSpecialClientName = null)
    {
        // validation for constraint: boolean
        if (!is_null($isPrintSpecialClientName) && !is_bool($isPrintSpecialClientName)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($isPrintSpecialClientName, true), gettype($isPrintSpecialClientName)), __LINE__);
        }
        if (is_null($isPrintSpecialClientName) || (is_array($isPrintSpecialClientName) && empty($isPrintSpecialClientName))) {
            unset($this->IsPrintSpecialClientName);
        } else {
            $this->IsPrintSpecialClientName = $isPrintSpecialClientName;
        }
        return $this;
    }
    /**
     * Get NameOnDonation 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 string|null
     */
    public function getNameOnDonation()
    {
        return isset($this->NameOnDonation) ? $this->NameOnDonation : null;
    }
    /**
     * Set NameOnDonation 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 string $nameOnDonation
     * @return \patest\StructType\Printing_PrintableItem_DonationBase
     */
    public function setNameOnDonation($nameOnDonation = null)
    {
        // validation for constraint: string
        if (!is_null($nameOnDonation) && !is_string($nameOnDonation)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($nameOnDonation, true), gettype($nameOnDonation)), __LINE__);
        }
        if (is_null($nameOnDonation) || (is_array($nameOnDonation) && empty($nameOnDonation))) {
            unset($this->NameOnDonation);
        } else {
            $this->NameOnDonation = $nameOnDonation;
        }
        return $this;
    }
}
