<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for addLines StructType
 * @subpackage Structs
 */
class AddLines extends AbstractStructBase
{
    /**
     * The line
     * Meta informations extracted from the WSDL
     * - documentation: An XLine is an entry in the DeviceNumPlanMap table. The actual directory number is referenced inside the XLine object by the "dirn" or "dirnId" element.
     * - maxOccurs: unbounded
     * - minOccurs: 1
     * @var XPhoneLine[]
     */
    public $line;
    /**
     * The lineIdentifier
     * Meta informations extracted from the WSDL
     * - documentation: The lineIdentifier is a shorthand method that refers to a particular directory number.
     * - maxOccurs: unbounded
     * - minOccurs: 1
     * @var XNumplanIdentifier[]
     */
    public $lineIdentifier;
    /**
     * Constructor method for addLines
     * @uses AddLines::setLine()
     * @uses AddLines::setLineIdentifier()
     * @param XPhoneLine[] $line
     * @param XNumplanIdentifier[] $lineIdentifier
     */
    public function __construct(array $line = array(), array $lineIdentifier = array())
    {
        $this
            ->setLine($line)
            ->setLineIdentifier($lineIdentifier);
    }
    /**
     * Get line value
     * @return XPhoneLine[]
     */
    public function getLine()
    {
        return $this->line;
    }
    /**
     * Set line value
     * @throws \InvalidArgumentException
     * @param XPhoneLine[] $line
     * @return AddLines
     */
    public function setLine(array $line = array())
    {
        foreach ($line as $addLinesLineItem) {
            // validation for constraint: itemType
            if (!$addLinesLineItem instanceof XPhoneLine) {
                throw new \InvalidArgumentException(sprintf('The line property can only contain items of XPhoneLine, "%s" given', is_object($addLinesLineItem) ? get_class($addLinesLineItem) : gettype($addLinesLineItem)), __LINE__);
            }
        }
        $this->line = $line;
        return $this;
    }
    /**
     * Add item to line value
     * @throws \InvalidArgumentException
     * @param XPhoneLine $item
     * @return AddLines
     */
    public function addToLine(XPhoneLine $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof XPhoneLine) {
            throw new \InvalidArgumentException(sprintf('The line property can only contain items of XPhoneLine, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->line[] = $item;
        return $this;
    }
    /**
     * Get lineIdentifier value
     * @return XNumplanIdentifier[]
     */
    public function getLineIdentifier()
    {
        return $this->lineIdentifier;
    }
    /**
     * Set lineIdentifier value
     * @throws \InvalidArgumentException
     * @param XNumplanIdentifier[] $lineIdentifier
     * @return AddLines
     */
    public function setLineIdentifier(array $lineIdentifier = array())
    {
        foreach ($lineIdentifier as $addLinesLineIdentifierItem) {
            // validation for constraint: itemType
            if (!$addLinesLineIdentifierItem instanceof XNumplanIdentifier) {
                throw new \InvalidArgumentException(sprintf('The lineIdentifier property can only contain items of XNumplanIdentifier, "%s" given', is_object($addLinesLineIdentifierItem) ? get_class($addLinesLineIdentifierItem) : gettype($addLinesLineIdentifierItem)), __LINE__);
            }
        }
        $this->lineIdentifier = $lineIdentifier;
        return $this;
    }
    /**
     * Add item to lineIdentifier value
     * @throws \InvalidArgumentException
     * @param XNumplanIdentifier $item
     * @return AddLines
     */
    public function addToLineIdentifier(XNumplanIdentifier $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof XNumplanIdentifier) {
            throw new \InvalidArgumentException(sprintf('The lineIdentifier property can only contain items of XNumplanIdentifier, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->lineIdentifier[] = $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 AddLines
     */
    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__;
    }
}
