<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Recruiting_Self-Schedule_Calendar_Response_DataType
 * StructType
 * Meta information extracted from the WSDL
 * - documentation: Element containing data for the Recruiting Self-Schedule Calendar.
 * @subpackage Structs
 */
class Recruiting_Self_Schedule_Calendar_Response_DataType extends AbstractStructBase
{
    /**
     * The Recruiting_Self_Schedule_Calendar
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\Recruiting_Self_Schedule_CalendarType[]
     */
    public $Recruiting_Self_Schedule_Calendar;
    /**
     * Constructor method for Recruiting_Self-Schedule_Calendar_Response_DataType
     * @uses Recruiting_Self_Schedule_Calendar_Response_DataType::setRecruiting_Self_Schedule_Calendar()
     * @param \StructType\Recruiting_Self_Schedule_CalendarType[] $recruiting_Self_Schedule_Calendar
     */
    public function __construct(array $recruiting_Self_Schedule_Calendar = array())
    {
        $this
            ->setRecruiting_Self_Schedule_Calendar($recruiting_Self_Schedule_Calendar);
    }
    /**
     * Get Recruiting_Self_Schedule_Calendar value
     * @return \StructType\Recruiting_Self_Schedule_CalendarType[]|null
     */
    public function getRecruiting_Self_Schedule_Calendar()
    {
        return $this->{'Recruiting_Self-Schedule_Calendar'};
    }
    /**
     * This method is responsible for validating the values passed to the setRecruiting_Self_Schedule_Calendar method
     * This method is willingly generated in order to preserve the one-line inline validation within the setRecruiting_Self_Schedule_Calendar 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_CalendarForArrayConstraintsFromSetRecruiting_Self_Schedule_Calendar(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $recruiting_Self_Schedule_Calendar_Response_DataTypeRecruiting_Self_Schedule_CalendarItem) {
            // validation for constraint: itemType
            if (!$recruiting_Self_Schedule_Calendar_Response_DataTypeRecruiting_Self_Schedule_CalendarItem instanceof \StructType\Recruiting_Self_Schedule_CalendarType) {
                $invalidValues[] = is_object($recruiting_Self_Schedule_Calendar_Response_DataTypeRecruiting_Self_Schedule_CalendarItem) ? get_class($recruiting_Self_Schedule_Calendar_Response_DataTypeRecruiting_Self_Schedule_CalendarItem) : sprintf('%s(%s)', gettype($recruiting_Self_Schedule_Calendar_Response_DataTypeRecruiting_Self_Schedule_CalendarItem), var_export($recruiting_Self_Schedule_Calendar_Response_DataTypeRecruiting_Self_Schedule_CalendarItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The Recruiting_Self_Schedule_Calendar property can only contain items of type \StructType\Recruiting_Self_Schedule_CalendarType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set Recruiting_Self_Schedule_Calendar value
     * @throws \InvalidArgumentException
     * @param \StructType\Recruiting_Self_Schedule_CalendarType[] $recruiting_Self_Schedule_Calendar
     * @return \StructType\Recruiting_Self_Schedule_Calendar_Response_DataType
     */
    public function setRecruiting_Self_Schedule_Calendar(array $recruiting_Self_Schedule_Calendar = array())
    {
        // validation for constraint: array
        if ('' !== ($recruiting_Self_Schedule_CalendarArrayErrorMessage = self::validateRecruiting_Self_Schedule_CalendarForArrayConstraintsFromSetRecruiting_Self_Schedule_Calendar($recruiting_Self_Schedule_Calendar))) {
            throw new \InvalidArgumentException($recruiting_Self_Schedule_CalendarArrayErrorMessage, __LINE__);
        }
        $this->Recruiting_Self_Schedule_Calendar = $this->{'Recruiting_Self-Schedule_Calendar'} = $recruiting_Self_Schedule_Calendar;
        return $this;
    }
    /**
     * Add item to Recruiting_Self_Schedule_Calendar value
     * @throws \InvalidArgumentException
     * @param \StructType\Recruiting_Self_Schedule_CalendarType $item
     * @return \StructType\Recruiting_Self_Schedule_Calendar_Response_DataType
     */
    public function addToRecruiting_Self_Schedule_Calendar(\StructType\Recruiting_Self_Schedule_CalendarType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\Recruiting_Self_Schedule_CalendarType) {
            throw new \InvalidArgumentException(sprintf('The Recruiting_Self_Schedule_Calendar property can only contain items of type \StructType\Recruiting_Self_Schedule_CalendarType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->Recruiting_Self_Schedule_Calendar[] = $this->{'Recruiting_Self-Schedule_Calendar'}[] = $item;
        return $this;
    }
}
