<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for phoneNtpReferences StructType
 * @subpackage Structs
 */
class PhoneNtpReferences extends XCommonMembersExtension
{
    /**
     * The selectedPhoneNtpReference
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var XDateTimeGroupNtpReference[]
     */
    public $selectedPhoneNtpReference;
    /**
     * Constructor method for phoneNtpReferences
     * @uses PhoneNtpReferences::setSelectedPhoneNtpReference()
     * @param XDateTimeGroupNtpReference[] $selectedPhoneNtpReference
     */
    public function __construct(array $selectedPhoneNtpReference = array())
    {
        $this
            ->setSelectedPhoneNtpReference($selectedPhoneNtpReference);
    }
    /**
     * Get selectedPhoneNtpReference value
     * @return XDateTimeGroupNtpReference[]|null
     */
    public function getSelectedPhoneNtpReference()
    {
        return $this->selectedPhoneNtpReference;
    }
    /**
     * Set selectedPhoneNtpReference value
     * @throws \InvalidArgumentException
     * @param XDateTimeGroupNtpReference[] $selectedPhoneNtpReference
     * @return PhoneNtpReferences
     */
    public function setSelectedPhoneNtpReference(array $selectedPhoneNtpReference = array())
    {
        foreach ($selectedPhoneNtpReference as $phoneNtpReferencesSelectedPhoneNtpReferenceItem) {
            // validation for constraint: itemType
            if (!$phoneNtpReferencesSelectedPhoneNtpReferenceItem instanceof XDateTimeGroupNtpReference) {
                throw new \InvalidArgumentException(sprintf('The selectedPhoneNtpReference property can only contain items of XDateTimeGroupNtpReference, "%s" given', is_object($phoneNtpReferencesSelectedPhoneNtpReferenceItem) ? get_class($phoneNtpReferencesSelectedPhoneNtpReferenceItem) : gettype($phoneNtpReferencesSelectedPhoneNtpReferenceItem)), __LINE__);
            }
        }
        $this->selectedPhoneNtpReference = $selectedPhoneNtpReference;
        return $this;
    }
    /**
     * Add item to selectedPhoneNtpReference value
     * @throws \InvalidArgumentException
     * @param XDateTimeGroupNtpReference $item
     * @return PhoneNtpReferences
     */
    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 PhoneNtpReferences
     */
    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__;
    }
}
