<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Printing.PrintableItem.ConfirmationLetter StructType
 * @subpackage Structs
 */
class Printing_PrintableItem_ConfirmationLetter extends Printing_PrintableItem_Base
{
    /**
     * The To
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\StructType\Printing_Item_ComplexProperty_ConfirmationLetter_To
     */
    public $To;
    /**
     * Constructor method for Printing.PrintableItem.ConfirmationLetter
     * @uses Printing_PrintableItem_ConfirmationLetter::setTo()
     * @param \patest\StructType\Printing_Item_ComplexProperty_ConfirmationLetter_To $to
     */
    public function __construct(\patest\StructType\Printing_Item_ComplexProperty_ConfirmationLetter_To $to = null)
    {
        $this
            ->setTo($to);
    }
    /**
     * Get To 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\Printing_Item_ComplexProperty_ConfirmationLetter_To|null
     */
    public function getTo()
    {
        return isset($this->To) ? $this->To : null;
    }
    /**
     * Set To 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\Printing_Item_ComplexProperty_ConfirmationLetter_To $to
     * @return \patest\StructType\Printing_PrintableItem_ConfirmationLetter
     */
    public function setTo(\patest\StructType\Printing_Item_ComplexProperty_ConfirmationLetter_To $to = null)
    {
        if (is_null($to) || (is_array($to) && empty($to))) {
            unset($this->To);
        } else {
            $this->To = $to;
        }
        return $this;
    }
}
