<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for
 * Recruiting_Self-Schedule_Calendar_Type_Request_ReferencesType StructType
 * Meta information extracted from the WSDL
 * - documentation: Element containing references to Recruiting Self-Schedule Calendar Types to retrieve.
 * @subpackage Structs
 */
class Recruiting_Self_Schedule_Calendar_Type_Request_ReferencesType extends AbstractStructBase
{
    /**
     * The Recruiting_Self_Schedule_Calendar_Type_Reference
     * Meta information extracted from the WSDL
     * - documentation: References to Recruiting Self-Schedule Calendar Types to retrieve.
     * - maxOccurs: unbounded
     * @var \StructType\Recruiting_Self_Schedule_Calendar_TypeObjectType[]
     */
    public $Recruiting_Self_Schedule_Calendar_Type_Reference;
    /**
     * Constructor method for
     * Recruiting_Self-Schedule_Calendar_Type_Request_ReferencesType
     * @uses Recruiting_Self_Schedule_Calendar_Type_Request_ReferencesType::setRecruiting_Self_Schedule_Calendar_Type_Reference()
     * @param \StructType\Recruiting_Self_Schedule_Calendar_TypeObjectType[] $recruiting_Self_Schedule_Calendar_Type_Reference
     */
    public function __construct(array $recruiting_Self_Schedule_Calendar_Type_Reference = array())
    {
        $this
            ->setRecruiting_Self_Schedule_Calendar_Type_Reference($recruiting_Self_Schedule_Calendar_Type_Reference);
    }
    /**
     * Get Recruiting_Self_Schedule_Calendar_Type_Reference value
     * @return \StructType\Recruiting_Self_Schedule_Calendar_TypeObjectType[]|null
     */
    public function getRecruiting_Self_Schedule_Calendar_Type_Reference()
    {
        return $this->{'Recruiting_Self-Schedule_Calendar_Type_Reference'};
    }
    /**
     * This method is responsible for validating the values passed to the setRecruiting_Self_Schedule_Calendar_Type_Reference method
     * This method is willingly generated in order to preserve the one-line inline validation within the setRecruiting_Self_Schedule_Calendar_Type_Reference 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_Type_ReferenceForArrayConstraintsFromSetRecruiting_Self_Schedule_Calendar_Type_Reference(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $recruiting_Self_Schedule_Calendar_Type_Request_ReferencesTypeRecruiting_Self_Schedule_Calendar_Type_ReferenceItem) {
            // validation for constraint: itemType
            if (!$recruiting_Self_Schedule_Calendar_Type_Request_ReferencesTypeRecruiting_Self_Schedule_Calendar_Type_ReferenceItem instanceof \StructType\Recruiting_Self_Schedule_Calendar_TypeObjectType) {
                $invalidValues[] = is_object($recruiting_Self_Schedule_Calendar_Type_Request_ReferencesTypeRecruiting_Self_Schedule_Calendar_Type_ReferenceItem) ? get_class($recruiting_Self_Schedule_Calendar_Type_Request_ReferencesTypeRecruiting_Self_Schedule_Calendar_Type_ReferenceItem) : sprintf('%s(%s)', gettype($recruiting_Self_Schedule_Calendar_Type_Request_ReferencesTypeRecruiting_Self_Schedule_Calendar_Type_ReferenceItem), var_export($recruiting_Self_Schedule_Calendar_Type_Request_ReferencesTypeRecruiting_Self_Schedule_Calendar_Type_ReferenceItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The Recruiting_Self_Schedule_Calendar_Type_Reference property can only contain items of type \StructType\Recruiting_Self_Schedule_Calendar_TypeObjectType, %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_Reference value
     * @throws \InvalidArgumentException
     * @param \StructType\Recruiting_Self_Schedule_Calendar_TypeObjectType[] $recruiting_Self_Schedule_Calendar_Type_Reference
     * @return \StructType\Recruiting_Self_Schedule_Calendar_Type_Request_ReferencesType
     */
    public function setRecruiting_Self_Schedule_Calendar_Type_Reference(array $recruiting_Self_Schedule_Calendar_Type_Reference = array())
    {
        // validation for constraint: array
        if ('' !== ($recruiting_Self_Schedule_Calendar_Type_ReferenceArrayErrorMessage = self::validateRecruiting_Self_Schedule_Calendar_Type_ReferenceForArrayConstraintsFromSetRecruiting_Self_Schedule_Calendar_Type_Reference($recruiting_Self_Schedule_Calendar_Type_Reference))) {
            throw new \InvalidArgumentException($recruiting_Self_Schedule_Calendar_Type_ReferenceArrayErrorMessage, __LINE__);
        }
        $this->Recruiting_Self_Schedule_Calendar_Type_Reference = $this->{'Recruiting_Self-Schedule_Calendar_Type_Reference'} = $recruiting_Self_Schedule_Calendar_Type_Reference;
        return $this;
    }
    /**
     * Add item to Recruiting_Self_Schedule_Calendar_Type_Reference value
     * @throws \InvalidArgumentException
     * @param \StructType\Recruiting_Self_Schedule_Calendar_TypeObjectType $item
     * @return \StructType\Recruiting_Self_Schedule_Calendar_Type_Request_ReferencesType
     */
    public function addToRecruiting_Self_Schedule_Calendar_Type_Reference(\StructType\Recruiting_Self_Schedule_Calendar_TypeObjectType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\Recruiting_Self_Schedule_Calendar_TypeObjectType) {
            throw new \InvalidArgumentException(sprintf('The Recruiting_Self_Schedule_Calendar_Type_Reference property can only contain items of type \StructType\Recruiting_Self_Schedule_Calendar_TypeObjectType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->Recruiting_Self_Schedule_Calendar_Type_Reference[] = $this->{'Recruiting_Self-Schedule_Calendar_Type_Reference'}[] = $item;
        return $this;
    }
}
