<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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