<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for addPhoneNtpReferences StructType
 * @subpackage Structs
 */
class AddPhoneNtpReferences extends XCommonMembersExtension
{
    /**
     * The selectedPhoneNtpReference
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 1
     * @var XDateTimeGroupNtpReference[]
     */
    public $selectedPhoneNtpReference;
    /**
     * Constructor method for addPhoneNtpReferences
     * @uses AddPhoneNtpReferences::setSelectedPhoneNtpReference()
     * @param XDateTimeGroupNtpReference[] $selectedPhoneNtpReference
     */
    public function __construct(array $selectedPhoneNtpReference = array())
    {
        $this
            ->setSelectedPhoneNtpReference($selectedPhoneNtpReference);
    }
    /**
     * Get selectedPhoneNtpReference value
     * @return XDateTimeGroupNtpReference[]
     */
    public function getSelectedPhoneNtpReference()
    {
        return $this->selectedPhoneNtpReference;
    }
    /**
     * Set selectedPhoneNtpReference value
     * @throws \InvalidArgumentException
     * @param XDateTimeGroupNtpReference[] $selectedPhoneNtpReference
     * @return AddPhoneNtpReferences
     */
    public function setSelectedPhoneNtpReference(array $selectedPhoneNtpReference = array())
    {
        foreach ($selectedPhoneNtpReference as $addPhoneNtpReferencesSelectedPhoneNtpReferenceItem) {
            // validation for constraint: itemType
            if (!$addPhoneNtpReferencesSelectedPhoneNtpReferenceItem instanceof XDateTimeGroupNtpReference) {
                throw new \InvalidArgumentException(sprintf('The selectedPhoneNtpReference property can only contain items of XDateTimeGroupNtpReference, "%s" given', is_object($addPhoneNtpReferencesSelectedPhoneNtpReferenceItem) ? get_class($addPhoneNtpReferencesSelectedPhoneNtpReferenceItem) : gettype($addPhoneNtpReferencesSelectedPhoneNtpReferenceItem)), __LINE__);
            }
        }
        $this->selectedPhoneNtpReference = $selectedPhoneNtpReference;
        return $this;
    }
    /**
     * Add item to selectedPhoneNtpReference value
     * @throws \InvalidArgumentException
     * @param XDateTimeGroupNtpReference $item
     * @return AddPhoneNtpReferences
     */
    public function addToSelectedPhoneNtpReference(XDateTimeGroupNtpReference $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof XDateTimeGroupNtpReference) {
            throw new \InvalidArgumentException(sprintf('The selectedPhoneNtpReference property can only contain items of XDateTimeGroupNtpReference, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->selectedPhoneNtpReference[] = $item;
        return $this;
    }
    /**
     * Method called when an object has been exported with var_export() functions
     * It allows to return an object instantiated with the values
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return AddPhoneNtpReferences
     */
    public static function __set_state(array $array)
    {
        return parent::__set_state($array);
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
