<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Worker_Travel_Profile_Listing_File_Response_DataType
 * StructType
 * Meta information extracted from the WSDL
 * - documentation: Travel Profile Listing File Response Data.
 * @subpackage Structs
 */
class Worker_Travel_Profile_Listing_File_Response_DataType extends AbstractStructBase
{
    /**
     * The Worker_Travel_Profile_Listing_File
     * Meta information extracted from the WSDL
     * - documentation: Worker Travel Profile Listing File
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\Worker_Travel_Profile_Listing_FileType[]
     */
    public $Worker_Travel_Profile_Listing_File;
    /**
     * Constructor method for Worker_Travel_Profile_Listing_File_Response_DataType
     * @uses Worker_Travel_Profile_Listing_File_Response_DataType::setWorker_Travel_Profile_Listing_File()
     * @param \StructType\Worker_Travel_Profile_Listing_FileType[] $worker_Travel_Profile_Listing_File
     */
    public function __construct(array $worker_Travel_Profile_Listing_File = array())
    {
        $this
            ->setWorker_Travel_Profile_Listing_File($worker_Travel_Profile_Listing_File);
    }
    /**
     * Get Worker_Travel_Profile_Listing_File value
     * @return \StructType\Worker_Travel_Profile_Listing_FileType[]|null
     */
    public function getWorker_Travel_Profile_Listing_File()
    {
        return $this->Worker_Travel_Profile_Listing_File;
    }
    /**
     * This method is responsible for validating the values passed to the setWorker_Travel_Profile_Listing_File method
     * This method is willingly generated in order to preserve the one-line inline validation within the setWorker_Travel_Profile_Listing_File 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_FileForArrayConstraintsFromSetWorker_Travel_Profile_Listing_File(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $worker_Travel_Profile_Listing_File_Response_DataTypeWorker_Travel_Profile_Listing_FileItem) {
            // validation for constraint: itemType
            if (!$worker_Travel_Profile_Listing_File_Response_DataTypeWorker_Travel_Profile_Listing_FileItem instanceof \StructType\Worker_Travel_Profile_Listing_FileType) {
                $invalidValues[] = is_object($worker_Travel_Profile_Listing_File_Response_DataTypeWorker_Travel_Profile_Listing_FileItem) ? get_class($worker_Travel_Profile_Listing_File_Response_DataTypeWorker_Travel_Profile_Listing_FileItem) : sprintf('%s(%s)', gettype($worker_Travel_Profile_Listing_File_Response_DataTypeWorker_Travel_Profile_Listing_FileItem), var_export($worker_Travel_Profile_Listing_File_Response_DataTypeWorker_Travel_Profile_Listing_FileItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The Worker_Travel_Profile_Listing_File property can only contain items of type \StructType\Worker_Travel_Profile_Listing_FileType, %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 value
     * @throws \InvalidArgumentException
     * @param \StructType\Worker_Travel_Profile_Listing_FileType[] $worker_Travel_Profile_Listing_File
     * @return \StructType\Worker_Travel_Profile_Listing_File_Response_DataType
     */
    public function setWorker_Travel_Profile_Listing_File(array $worker_Travel_Profile_Listing_File = array())
    {
        // validation for constraint: array
        if ('' !== ($worker_Travel_Profile_Listing_FileArrayErrorMessage = self::validateWorker_Travel_Profile_Listing_FileForArrayConstraintsFromSetWorker_Travel_Profile_Listing_File($worker_Travel_Profile_Listing_File))) {
            throw new \InvalidArgumentException($worker_Travel_Profile_Listing_FileArrayErrorMessage, __LINE__);
        }
        $this->Worker_Travel_Profile_Listing_File = $worker_Travel_Profile_Listing_File;
        return $this;
    }
    /**
     * Add item to Worker_Travel_Profile_Listing_File value
     * @throws \InvalidArgumentException
     * @param \StructType\Worker_Travel_Profile_Listing_FileType $item
     * @return \StructType\Worker_Travel_Profile_Listing_File_Response_DataType
     */
    public function addToWorker_Travel_Profile_Listing_File(\StructType\Worker_Travel_Profile_Listing_FileType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\Worker_Travel_Profile_Listing_FileType) {
            throw new \InvalidArgumentException(sprintf('The Worker_Travel_Profile_Listing_File property can only contain items of type \StructType\Worker_Travel_Profile_Listing_FileType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->Worker_Travel_Profile_Listing_File[] = $item;
        return $this;
    }
}
