<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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