<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for plars StructType
 * Meta informations extracted from the WSDL
 * - documentation: Plars details cannot be added for dial pattern of type 7905_7912 | Plars details cannot be added for dial pattern of type 7905_7912
 * @subpackage Structs
 */
class Plars extends XCommonMembersExtension
{
    /**
     * The plar
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var XPatternMember[]
     */
    public $plar;
    /**
     * Constructor method for plars
     * @uses Plars::setPlar()
     * @param XPatternMember[] $plar
     */
    public function __construct(array $plar = array())
    {
        $this
            ->setPlar($plar);
    }
    /**
     * Get plar value
     * @return XPatternMember[]|null
     */
    public function getPlar()
    {
        return $this->plar;
    }
    /**
     * Set plar value
     * @throws \InvalidArgumentException
     * @param XPatternMember[] $plar
     * @return Plars
     */
    public function setPlar(array $plar = array())
    {
        foreach ($plar as $plarsPlarItem) {
            // validation for constraint: itemType
            if (!$plarsPlarItem instanceof XPatternMember) {
                throw new \InvalidArgumentException(sprintf('The plar property can only contain items of XPatternMember, "%s" given', is_object($plarsPlarItem) ? get_class($plarsPlarItem) : gettype($plarsPlarItem)), __LINE__);
            }
        }
        $this->plar = $plar;
        return $this;
    }
    /**
     * Add item to plar value
     * @throws \InvalidArgumentException
     * @param XPatternMember $item
     * @return Plars
     */
    public function addToPlar(XPatternMember $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof XPatternMember) {
            throw new \InvalidArgumentException(sprintf('The plar property can only contain items of XPatternMember, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->plar[] = $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 Plars
     */
    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__;
    }
}
