<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Recruiting_Self-Schedule_Calendar_Type_Response_DataType
 * StructType
 * Meta information extracted from the WSDL
 * - documentation: Element containing data for the Recruiting Self-Schedule Calendar Type.
 * @subpackage Structs
 */
class Recruiting_Self_Schedule_Calendar_Type_Response_DataType extends AbstractStructBase
{
    /**
     * The Recruiting_Self_Schedule_Calendar_Type
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\Recruiting_Self_Schedule_Calendar_TypeType[]
     */
    public $Recruiting_Self_Schedule_Calendar_Type;
    /**
     * Constructor method for Recruiting_Self-Schedule_Calendar_Type_Response_DataType
     * @uses Recruiting_Self_Schedule_Calendar_Type_Response_DataType::setRecruiting_Self_Schedule_Calendar_Type()
     * @param \StructType\Recruiting_Self_Schedule_Calendar_TypeType[] $recruiting_Self_Schedule_Calendar_Type
     */
    public function __construct(array $recruiting_Self_Schedule_Calendar_Type = array())
    {
        $this
            ->setRecruiting_Self_Schedule_Calendar_Type($recruiting_Self_Schedule_Calendar_Type);
    }
    /**
     * Get Recruiting_Self_Schedule_Calendar_Type value
     * @return \StructType\Recruiting_Self_Schedule_Calendar_TypeType[]|null
     */
    public function getRecruiting_Self_Schedule_Calendar_Type()
    {
        return $this->{'Recruiting_Self-Schedule_Calendar_Type'};
    }
    /**
     * This method is responsible for validating the values passed to the setRecruiting_Self_Schedule_Calendar_Type method
     * This method is willingly generated in order to preserve the one-line inline validation within the setRecruiting_Self_Schedule_Calendar_Type method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateRecruiting_Self_Schedule_Calendar_TypeForArrayConstraintsFromSetRecruiting_Self_Schedule_Calendar_Type(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $recruiting_Self_Schedule_Calendar_Type_Response_DataTypeRecruiting_Self_Schedule_Calendar_TypeItem) {
            // validation for constraint: itemType
            if (!$recruiting_Self_Schedule_Calendar_Type_Response_DataTypeRecruiting_Self_Schedule_Calendar_TypeItem instanceof \StructType\Recruiting_Self_Schedule_Calendar_TypeType) {
                $invalidValues[] = is_object($recruiting_Self_Schedule_Calendar_Type_Response_DataTypeRecruiting_Self_Schedule_Calendar_TypeItem) ? get_class($recruiting_Self_Schedule_Calendar_Type_Response_DataTypeRecruiting_Self_Schedule_Calendar_TypeItem) : sprintf('%s(%s)', gettype($recruiting_Self_Schedule_Calendar_Type_Response_DataTypeRecruiting_Self_Schedule_Calendar_TypeItem), var_export($recruiting_Self_Schedule_Calendar_Type_Response_DataTypeRecruiting_Self_Schedule_Calendar_TypeItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The Recruiting_Self_Schedule_Calendar_Type property can only contain items of type \StructType\Recruiting_Self_Schedule_Calendar_TypeType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set Recruiting_Self_Schedule_Calendar_Type value
     * @throws \InvalidArgumentException
     * @param \StructType\Recruiting_Self_Schedule_Calendar_TypeType[] $recruiting_Self_Schedule_Calendar_Type
     * @return \StructType\Recruiting_Self_Schedule_Calendar_Type_Response_DataType
     */
    public function setRecruiting_Self_Schedule_Calendar_Type(array $recruiting_Self_Schedule_Calendar_Type = array())
    {
        // validation for constraint: array
        if ('' !== ($recruiting_Self_Schedule_Calendar_TypeArrayErrorMessage = self::validateRecruiting_Self_Schedule_Calendar_TypeForArrayConstraintsFromSetRecruiting_Self_Schedule_Calendar_Type($recruiting_Self_Schedule_Calendar_Type))) {
            throw new \InvalidArgumentException($recruiting_Self_Schedule_Calendar_TypeArrayErrorMessage, __LINE__);
        }
        $this->Recruiting_Self_Schedule_Calendar_Type = $this->{'Recruiting_Self-Schedule_Calendar_Type'} = $recruiting_Self_Schedule_Calendar_Type;
        return $this;
    }
    /**
     * Add item to Recruiting_Self_Schedule_Calendar_Type value
     * @throws \InvalidArgumentException
     * @param \StructType\Recruiting_Self_Schedule_Calendar_TypeType $item
     * @return \StructType\Recruiting_Self_Schedule_Calendar_Type_Response_DataType
     */
    public function addToRecruiting_Self_Schedule_Calendar_Type(\StructType\Recruiting_Self_Schedule_Calendar_TypeType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\Recruiting_Self_Schedule_Calendar_TypeType) {
            throw new \InvalidArgumentException(sprintf('The Recruiting_Self_Schedule_Calendar_Type property can only contain items of type \StructType\Recruiting_Self_Schedule_Calendar_TypeType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->Recruiting_Self_Schedule_Calendar_Type[] = $this->{'Recruiting_Self-Schedule_Calendar_Type'}[] = $item;
        return $this;
    }
}
