<?php

namespace Pepitelabs\PWS\EstimatingService;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for TrackingReferenceInformation EstimatingService
 * Meta information extracted from the WSDL
 * - documentation: TrackingReferenceInformation
 * - nillable: true
 * - type: tns:TrackingReferenceInformation
 * @subpackage Structs
 */
class TrackingReferenceInformation extends AbstractStructBase
{
    /**
     * The Reference1
     * Meta information extracted from the WSDL
     * - documentation: Reference1 - string
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Reference1;
    /**
     * The Reference2
     * Meta information extracted from the WSDL
     * - documentation: Reference2 - string
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Reference2;
    /**
     * The Reference3
     * Meta information extracted from the WSDL
     * - documentation: Reference3 - string
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Reference3;
    /**
     * The Reference4
     * Meta information extracted from the WSDL
     * - documentation: Reference4 - string
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Reference4;
    /**
     * Constructor method for TrackingReferenceInformation
     * @uses TrackingReferenceInformation::setReference1()
     * @uses TrackingReferenceInformation::setReference2()
     * @uses TrackingReferenceInformation::setReference3()
     * @uses TrackingReferenceInformation::setReference4()
     * @param string $reference1
     * @param string $reference2
     * @param string $reference3
     * @param string $reference4
     */
    public function __construct($reference1 = null, $reference2 = null, $reference3 = null, $reference4 = null)
    {
        $this
            ->setReference1($reference1)
            ->setReference2($reference2)
            ->setReference3($reference3)
            ->setReference4($reference4);
    }
    /**
     * Get Reference1 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 getReference1()
    {
        return isset($this->Reference1) ? $this->Reference1 : null;
    }
    /**
     * Set Reference1 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 $reference1
     * @return \Pepitelabs\PWS\EstimatingService\TrackingReferenceInformation
     */
    public function setReference1($reference1 = null)
    {
        // validation for constraint: string
        if (!is_null($reference1) && !is_string($reference1)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($reference1, true), gettype($reference1)), __LINE__);
        }
        if (is_null($reference1) || (is_array($reference1) && empty($reference1))) {
            unset($this->Reference1);
        } else {
            $this->Reference1 = $reference1;
        }
        return $this;
    }
    /**
     * Get Reference2 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 getReference2()
    {
        return isset($this->Reference2) ? $this->Reference2 : null;
    }
    /**
     * Set Reference2 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 $reference2
     * @return \Pepitelabs\PWS\EstimatingService\TrackingReferenceInformation
     */
    public function setReference2($reference2 = null)
    {
        // validation for constraint: string
        if (!is_null($reference2) && !is_string($reference2)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($reference2, true), gettype($reference2)), __LINE__);
        }
        if (is_null($reference2) || (is_array($reference2) && empty($reference2))) {
            unset($this->Reference2);
        } else {
            $this->Reference2 = $reference2;
        }
        return $this;
    }
    /**
     * Get Reference3 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 getReference3()
    {
        return isset($this->Reference3) ? $this->Reference3 : null;
    }
    /**
     * Set Reference3 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 $reference3
     * @return \Pepitelabs\PWS\EstimatingService\TrackingReferenceInformation
     */
    public function setReference3($reference3 = null)
    {
        // validation for constraint: string
        if (!is_null($reference3) && !is_string($reference3)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($reference3, true), gettype($reference3)), __LINE__);
        }
        if (is_null($reference3) || (is_array($reference3) && empty($reference3))) {
            unset($this->Reference3);
        } else {
            $this->Reference3 = $reference3;
        }
        return $this;
    }
    /**
     * Get Reference4 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 getReference4()
    {
        return isset($this->Reference4) ? $this->Reference4 : null;
    }
    /**
     * Set Reference4 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 $reference4
     * @return \Pepitelabs\PWS\EstimatingService\TrackingReferenceInformation
     */
    public function setReference4($reference4 = null)
    {
        // validation for constraint: string
        if (!is_null($reference4) && !is_string($reference4)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($reference4, true), gettype($reference4)), __LINE__);
        }
        if (is_null($reference4) || (is_array($reference4) && empty($reference4))) {
            unset($this->Reference4);
        } else {
            $this->Reference4 = $reference4;
        }
        return $this;
    }
    /**
     * Method called when an object has been exported with var_export() functions
     * It allows to return an object instantiated with the values
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return \Pepitelabs\PWS\EstimatingService\TrackingReferenceInformation
     */
    public static function __set_state(array $array)
    {
        return parent::__set_state($array);
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
