<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

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