<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for GiftVoucher.GiftCardProviderConfig.Sro StructType
 * @subpackage Structs
 */
class GiftVoucher_GiftCardProviderConfig_Sro extends GiftVoucher_GiftCardProviderConfigBase
{
    /**
     * The SroData
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $SroData;
    /**
     * Constructor method for GiftVoucher.GiftCardProviderConfig.Sro
     * @uses GiftVoucher_GiftCardProviderConfig_Sro::setSroData()
     * @param string $sroData
     */
    public function __construct($sroData = null)
    {
        $this
            ->setSroData($sroData);
    }
    /**
     * Get SroData 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 getSroData()
    {
        return isset($this->SroData) ? $this->SroData : null;
    }
    /**
     * Set SroData 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 $sroData
     * @return \patest\StructType\GiftVoucher_GiftCardProviderConfig_Sro
     */
    public function setSroData($sroData = null)
    {
        // validation for constraint: string
        if (!is_null($sroData) && !is_string($sroData)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sroData, true), gettype($sroData)), __LINE__);
        }
        if (is_null($sroData) || (is_array($sroData) && empty($sroData))) {
            unset($this->SroData);
        } else {
            $this->SroData = $sroData;
        }
        return $this;
    }
}
