<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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