<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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