<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Printing.PrintableItem.DonationTaxStatement StructType
 * @subpackage Structs
 */
class Printing_PrintableItem_DonationTaxStatement extends Printing_PrintableItem_DonationInfo
{
    /**
     * The StatedAmount
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var float
     */
    public $StatedAmount;
    /**
     * Constructor method for Printing.PrintableItem.DonationTaxStatement
     * @uses Printing_PrintableItem_DonationTaxStatement::setStatedAmount()
     * @param float $statedAmount
     */
    public function __construct($statedAmount = null)
    {
        $this
            ->setStatedAmount($statedAmount);
    }
    /**
     * Get StatedAmount 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 float|null
     */
    public function getStatedAmount()
    {
        return isset($this->StatedAmount) ? $this->StatedAmount : null;
    }
    /**
     * Set StatedAmount 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 float $statedAmount
     * @return \patest\StructType\Printing_PrintableItem_DonationTaxStatement
     */
    public function setStatedAmount($statedAmount = null)
    {
        // validation for constraint: float
        if (!is_null($statedAmount) && !(is_float($statedAmount) || is_numeric($statedAmount))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($statedAmount, true), gettype($statedAmount)), __LINE__);
        }
        if (is_null($statedAmount) || (is_array($statedAmount) && empty($statedAmount))) {
            unset($this->StatedAmount);
        } else {
            $this->StatedAmount = $statedAmount;
        }
        return $this;
    }
}
