<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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