<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Travel_Booking_File_Response_DataType StructType
 * Meta information extracted from the WSDL
 * - documentation: Travel Booking File Response Data.
 * @subpackage Structs
 */
class Travel_Booking_File_Response_DataType extends AbstractStructBase
{
    /**
     * The Travel_Booking_File
     * Meta information extracted from the WSDL
     * - documentation: Travel Booking File.
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\Travel_Booking_FileType[]
     */
    public $Travel_Booking_File;
    /**
     * Constructor method for Travel_Booking_File_Response_DataType
     * @uses Travel_Booking_File_Response_DataType::setTravel_Booking_File()
     * @param \StructType\Travel_Booking_FileType[] $travel_Booking_File
     */
    public function __construct(array $travel_Booking_File = array())
    {
        $this
            ->setTravel_Booking_File($travel_Booking_File);
    }
    /**
     * Get Travel_Booking_File value
     * @return \StructType\Travel_Booking_FileType[]|null
     */
    public function getTravel_Booking_File()
    {
        return $this->Travel_Booking_File;
    }
    /**
     * This method is responsible for validating the values passed to the setTravel_Booking_File method
     * This method is willingly generated in order to preserve the one-line inline validation within the setTravel_Booking_File method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateTravel_Booking_FileForArrayConstraintsFromSetTravel_Booking_File(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $travel_Booking_File_Response_DataTypeTravel_Booking_FileItem) {
            // validation for constraint: itemType
            if (!$travel_Booking_File_Response_DataTypeTravel_Booking_FileItem instanceof \StructType\Travel_Booking_FileType) {
                $invalidValues[] = is_object($travel_Booking_File_Response_DataTypeTravel_Booking_FileItem) ? get_class($travel_Booking_File_Response_DataTypeTravel_Booking_FileItem) : sprintf('%s(%s)', gettype($travel_Booking_File_Response_DataTypeTravel_Booking_FileItem), var_export($travel_Booking_File_Response_DataTypeTravel_Booking_FileItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The Travel_Booking_File property can only contain items of type \StructType\Travel_Booking_FileType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set Travel_Booking_File value
     * @throws \InvalidArgumentException
     * @param \StructType\Travel_Booking_FileType[] $travel_Booking_File
     * @return \StructType\Travel_Booking_File_Response_DataType
     */
    public function setTravel_Booking_File(array $travel_Booking_File = array())
    {
        // validation for constraint: array
        if ('' !== ($travel_Booking_FileArrayErrorMessage = self::validateTravel_Booking_FileForArrayConstraintsFromSetTravel_Booking_File($travel_Booking_File))) {
            throw new \InvalidArgumentException($travel_Booking_FileArrayErrorMessage, __LINE__);
        }
        $this->Travel_Booking_File = $travel_Booking_File;
        return $this;
    }
    /**
     * Add item to Travel_Booking_File value
     * @throws \InvalidArgumentException
     * @param \StructType\Travel_Booking_FileType $item
     * @return \StructType\Travel_Booking_File_Response_DataType
     */
    public function addToTravel_Booking_File(\StructType\Travel_Booking_FileType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\Travel_Booking_FileType) {
            throw new \InvalidArgumentException(sprintf('The Travel_Booking_File property can only contain items of type \StructType\Travel_Booking_FileType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->Travel_Booking_File[] = $item;
        return $this;
    }
}
