<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Worker_Travel_Profile_Listing_FileType StructType
 * Meta information extracted from the WSDL
 * - documentation: Worker Travel Profile Listing File
 * @subpackage Structs
 */
class Worker_Travel_Profile_Listing_FileType extends AbstractStructBase
{
    /**
     * The Worker_Travel_Profile_Listing_File_Reference
     * Meta information extracted from the WSDL
     * - documentation: Worker Travel Profile Listing File Reference
     * - minOccurs: 0
     * @var \StructType\Worker_Travel_Profile_Listing_FileObjectType
     */
    public $Worker_Travel_Profile_Listing_File_Reference;
    /**
     * The Worker_Travel_Profile_Listing_File_Data
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\Worker_Travel_Profile_Listing_File_WWSType[]
     */
    public $Worker_Travel_Profile_Listing_File_Data;
    /**
     * Constructor method for Worker_Travel_Profile_Listing_FileType
     * @uses Worker_Travel_Profile_Listing_FileType::setWorker_Travel_Profile_Listing_File_Reference()
     * @uses Worker_Travel_Profile_Listing_FileType::setWorker_Travel_Profile_Listing_File_Data()
     * @param \StructType\Worker_Travel_Profile_Listing_FileObjectType $worker_Travel_Profile_Listing_File_Reference
     * @param \StructType\Worker_Travel_Profile_Listing_File_WWSType[] $worker_Travel_Profile_Listing_File_Data
     */
    public function __construct(\StructType\Worker_Travel_Profile_Listing_FileObjectType $worker_Travel_Profile_Listing_File_Reference = null, array $worker_Travel_Profile_Listing_File_Data = array())
    {
        $this
            ->setWorker_Travel_Profile_Listing_File_Reference($worker_Travel_Profile_Listing_File_Reference)
            ->setWorker_Travel_Profile_Listing_File_Data($worker_Travel_Profile_Listing_File_Data);
    }
    /**
     * Get Worker_Travel_Profile_Listing_File_Reference value
     * @return \StructType\Worker_Travel_Profile_Listing_FileObjectType|null
     */
    public function getWorker_Travel_Profile_Listing_File_Reference()
    {
        return $this->Worker_Travel_Profile_Listing_File_Reference;
    }
    /**
     * Set Worker_Travel_Profile_Listing_File_Reference value
     * @param \StructType\Worker_Travel_Profile_Listing_FileObjectType $worker_Travel_Profile_Listing_File_Reference
     * @return \StructType\Worker_Travel_Profile_Listing_FileType
     */
    public function setWorker_Travel_Profile_Listing_File_Reference(\StructType\Worker_Travel_Profile_Listing_FileObjectType $worker_Travel_Profile_Listing_File_Reference = null)
    {
        $this->Worker_Travel_Profile_Listing_File_Reference = $worker_Travel_Profile_Listing_File_Reference;
        return $this;
    }
    /**
     * Get Worker_Travel_Profile_Listing_File_Data value
     * @return \StructType\Worker_Travel_Profile_Listing_File_WWSType[]|null
     */
    public function getWorker_Travel_Profile_Listing_File_Data()
    {
        return $this->Worker_Travel_Profile_Listing_File_Data;
    }
    /**
     * This method is responsible for validating the values passed to the setWorker_Travel_Profile_Listing_File_Data method
     * This method is willingly generated in order to preserve the one-line inline validation within the setWorker_Travel_Profile_Listing_File_Data method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateWorker_Travel_Profile_Listing_File_DataForArrayConstraintsFromSetWorker_Travel_Profile_Listing_File_Data(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $worker_Travel_Profile_Listing_FileTypeWorker_Travel_Profile_Listing_File_DataItem) {
            // validation for constraint: itemType
            if (!$worker_Travel_Profile_Listing_FileTypeWorker_Travel_Profile_Listing_File_DataItem instanceof \StructType\Worker_Travel_Profile_Listing_File_WWSType) {
                $invalidValues[] = is_object($worker_Travel_Profile_Listing_FileTypeWorker_Travel_Profile_Listing_File_DataItem) ? get_class($worker_Travel_Profile_Listing_FileTypeWorker_Travel_Profile_Listing_File_DataItem) : sprintf('%s(%s)', gettype($worker_Travel_Profile_Listing_FileTypeWorker_Travel_Profile_Listing_File_DataItem), var_export($worker_Travel_Profile_Listing_FileTypeWorker_Travel_Profile_Listing_File_DataItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The Worker_Travel_Profile_Listing_File_Data property can only contain items of type \StructType\Worker_Travel_Profile_Listing_File_WWSType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set Worker_Travel_Profile_Listing_File_Data value
     * @throws \InvalidArgumentException
     * @param \StructType\Worker_Travel_Profile_Listing_File_WWSType[] $worker_Travel_Profile_Listing_File_Data
     * @return \StructType\Worker_Travel_Profile_Listing_FileType
     */
    public function setWorker_Travel_Profile_Listing_File_Data(array $worker_Travel_Profile_Listing_File_Data = array())
    {
        // validation for constraint: array
        if ('' !== ($worker_Travel_Profile_Listing_File_DataArrayErrorMessage = self::validateWorker_Travel_Profile_Listing_File_DataForArrayConstraintsFromSetWorker_Travel_Profile_Listing_File_Data($worker_Travel_Profile_Listing_File_Data))) {
            throw new \InvalidArgumentException($worker_Travel_Profile_Listing_File_DataArrayErrorMessage, __LINE__);
        }
        $this->Worker_Travel_Profile_Listing_File_Data = $worker_Travel_Profile_Listing_File_Data;
        return $this;
    }
    /**
     * Add item to Worker_Travel_Profile_Listing_File_Data value
     * @throws \InvalidArgumentException
     * @param \StructType\Worker_Travel_Profile_Listing_File_WWSType $item
     * @return \StructType\Worker_Travel_Profile_Listing_FileType
     */
    public function addToWorker_Travel_Profile_Listing_File_Data(\StructType\Worker_Travel_Profile_Listing_File_WWSType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\Worker_Travel_Profile_Listing_File_WWSType) {
            throw new \InvalidArgumentException(sprintf('The Worker_Travel_Profile_Listing_File_Data property can only contain items of type \StructType\Worker_Travel_Profile_Listing_File_WWSType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->Worker_Travel_Profile_Listing_File_Data[] = $item;
        return $this;
    }
}
