<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for DonaitonRunBatchProcessRequest StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:DonaitonRunBatchProcessRequest
 * @subpackage Structs
 */
class DonaitonRunBatchProcessRequest extends AbstractStructBase
{
    /**
     * The Entries
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\ArrayType\ArrayOfDonation_DonationEntryDetail
     */
    public $Entries;
    /**
     * The FileName
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $FileName;
    /**
     * Constructor method for DonaitonRunBatchProcessRequest
     * @uses DonaitonRunBatchProcessRequest::setEntries()
     * @uses DonaitonRunBatchProcessRequest::setFileName()
     * @param \patest\ArrayType\ArrayOfDonation_DonationEntryDetail $entries
     * @param string $fileName
     */
    public function __construct(\patest\ArrayType\ArrayOfDonation_DonationEntryDetail $entries = null, $fileName = null)
    {
        $this
            ->setEntries($entries)
            ->setFileName($fileName);
    }
    /**
     * Get Entries 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\ArrayType\ArrayOfDonation_DonationEntryDetail|null
     */
    public function getEntries()
    {
        return isset($this->Entries) ? $this->Entries : null;
    }
    /**
     * Set Entries 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\ArrayType\ArrayOfDonation_DonationEntryDetail $entries
     * @return \patest\StructType\DonaitonRunBatchProcessRequest
     */
    public function setEntries(\patest\ArrayType\ArrayOfDonation_DonationEntryDetail $entries = null)
    {
        if (is_null($entries) || (is_array($entries) && empty($entries))) {
            unset($this->Entries);
        } else {
            $this->Entries = $entries;
        }
        return $this;
    }
    /**
     * Get FileName 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 getFileName()
    {
        return isset($this->FileName) ? $this->FileName : null;
    }
    /**
     * Set FileName 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 $fileName
     * @return \patest\StructType\DonaitonRunBatchProcessRequest
     */
    public function setFileName($fileName = null)
    {
        // validation for constraint: string
        if (!is_null($fileName) && !is_string($fileName)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fileName, true), gettype($fileName)), __LINE__);
        }
        if (is_null($fileName) || (is_array($fileName) && empty($fileName))) {
            unset($this->FileName);
        } else {
            $this->FileName = $fileName;
        }
        return $this;
    }
}
