<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Printing.PrintableItem.CollectTicketsBySms StructType
 * @subpackage Structs
 */
class Printing_PrintableItem_CollectTicketsBySms extends Printing_PrintableItem_Base
{
    /**
     * The Phone
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Phone;
    /**
     * The Tickets
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\StructType\RecordSetOfPrinting_PrintableItem_Ticket
     */
    public $Tickets;
    /**
     * Constructor method for Printing.PrintableItem.CollectTicketsBySms
     * @uses Printing_PrintableItem_CollectTicketsBySms::setPhone()
     * @uses Printing_PrintableItem_CollectTicketsBySms::setTickets()
     * @param string $phone
     * @param \patest\StructType\RecordSetOfPrinting_PrintableItem_Ticket $tickets
     */
    public function __construct($phone = null, \patest\StructType\RecordSetOfPrinting_PrintableItem_Ticket $tickets = null)
    {
        $this
            ->setPhone($phone)
            ->setTickets($tickets);
    }
    /**
     * Get Phone 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 getPhone()
    {
        return isset($this->Phone) ? $this->Phone : null;
    }
    /**
     * Set Phone 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 $phone
     * @return \patest\StructType\Printing_PrintableItem_CollectTicketsBySms
     */
    public function setPhone($phone = null)
    {
        // validation for constraint: string
        if (!is_null($phone) && !is_string($phone)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($phone, true), gettype($phone)), __LINE__);
        }
        if (is_null($phone) || (is_array($phone) && empty($phone))) {
            unset($this->Phone);
        } else {
            $this->Phone = $phone;
        }
        return $this;
    }
    /**
     * 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_CollectTicketsBySms
     */
    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;
    }
}
