<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Assign_Recruiting_Self-Schedule_Calendar_Response_DataType
 * StructType
 * Meta information extracted from the WSDL
 * - documentation: Recruiting Self-Schedule Event Calendar Assignment Data
 * @subpackage Structs
 */
class Assign_Recruiting_Self_Schedule_Calendar_Response_DataType extends AbstractStructBase
{
    /**
     * The Assign_Recruiting_Self_Schedule_Calendar
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\Assign_Recruiting_Self_Schedule_CalendarType[]
     */
    public $Assign_Recruiting_Self_Schedule_Calendar;
    /**
     * Constructor method for
     * Assign_Recruiting_Self-Schedule_Calendar_Response_DataType
     * @uses Assign_Recruiting_Self_Schedule_Calendar_Response_DataType::setAssign_Recruiting_Self_Schedule_Calendar()
     * @param \StructType\Assign_Recruiting_Self_Schedule_CalendarType[] $assign_Recruiting_Self_Schedule_Calendar
     */
    public function __construct(array $assign_Recruiting_Self_Schedule_Calendar = array())
    {
        $this
            ->setAssign_Recruiting_Self_Schedule_Calendar($assign_Recruiting_Self_Schedule_Calendar);
    }
    /**
     * Get Assign_Recruiting_Self_Schedule_Calendar value
     * @return \StructType\Assign_Recruiting_Self_Schedule_CalendarType[]|null
     */
    public function getAssign_Recruiting_Self_Schedule_Calendar()
    {
        return $this->{'Assign_Recruiting_Self-Schedule_Calendar'};
    }
    /**
     * This method is responsible for validating the values passed to the setAssign_Recruiting_Self_Schedule_Calendar method
     * This method is willingly generated in order to preserve the one-line inline validation within the setAssign_Recruiting_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 validateAssign_Recruiting_Self_Schedule_CalendarForArrayConstraintsFromSetAssign_Recruiting_Self_Schedule_Calendar(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $assign_Recruiting_Self_Schedule_Calendar_Response_DataTypeAssign_Recruiting_Self_Schedule_CalendarItem) {
            // validation for constraint: itemType
            if (!$assign_Recruiting_Self_Schedule_Calendar_Response_DataTypeAssign_Recruiting_Self_Schedule_CalendarItem instanceof \StructType\Assign_Recruiting_Self_Schedule_CalendarType) {
                $invalidValues[] = is_object($assign_Recruiting_Self_Schedule_Calendar_Response_DataTypeAssign_Recruiting_Self_Schedule_CalendarItem) ? get_class($assign_Recruiting_Self_Schedule_Calendar_Response_DataTypeAssign_Recruiting_Self_Schedule_CalendarItem) : sprintf('%s(%s)', gettype($assign_Recruiting_Self_Schedule_Calendar_Response_DataTypeAssign_Recruiting_Self_Schedule_CalendarItem), var_export($assign_Recruiting_Self_Schedule_Calendar_Response_DataTypeAssign_Recruiting_Self_Schedule_CalendarItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The Assign_Recruiting_Self_Schedule_Calendar property can only contain items of type \StructType\Assign_Recruiting_Self_Schedule_CalendarType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set Assign_Recruiting_Self_Schedule_Calendar value
     * @throws \InvalidArgumentException
     * @param \StructType\Assign_Recruiting_Self_Schedule_CalendarType[] $assign_Recruiting_Self_Schedule_Calendar
     * @return \StructType\Assign_Recruiting_Self_Schedule_Calendar_Response_DataType
     */
    public function setAssign_Recruiting_Self_Schedule_Calendar(array $assign_Recruiting_Self_Schedule_Calendar = array())
    {
        // validation for constraint: array
        if ('' !== ($assign_Recruiting_Self_Schedule_CalendarArrayErrorMessage = self::validateAssign_Recruiting_Self_Schedule_CalendarForArrayConstraintsFromSetAssign_Recruiting_Self_Schedule_Calendar($assign_Recruiting_Self_Schedule_Calendar))) {
            throw new \InvalidArgumentException($assign_Recruiting_Self_Schedule_CalendarArrayErrorMessage, __LINE__);
        }
        $this->Assign_Recruiting_Self_Schedule_Calendar = $this->{'Assign_Recruiting_Self-Schedule_Calendar'} = $assign_Recruiting_Self_Schedule_Calendar;
        return $this;
    }
    /**
     * Add item to Assign_Recruiting_Self_Schedule_Calendar value
     * @throws \InvalidArgumentException
     * @param \StructType\Assign_Recruiting_Self_Schedule_CalendarType $item
     * @return \StructType\Assign_Recruiting_Self_Schedule_Calendar_Response_DataType
     */
    public function addToAssign_Recruiting_Self_Schedule_Calendar(\StructType\Assign_Recruiting_Self_Schedule_CalendarType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\Assign_Recruiting_Self_Schedule_CalendarType) {
            throw new \InvalidArgumentException(sprintf('The Assign_Recruiting_Self_Schedule_Calendar property can only contain items of type \StructType\Assign_Recruiting_Self_Schedule_CalendarType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->Assign_Recruiting_Self_Schedule_Calendar[] = $this->{'Assign_Recruiting_Self-Schedule_Calendar'}[] = $item;
        return $this;
    }
}
