<?php

namespace \Losc\CucmBundle\Model\Webservice\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for addLines StructType
 * @subpackage Structs
 */
class AddLines extends AbstractStructBase
{
    /**
     * The line
     * Meta information 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.
     * - choice: line | lineIdentifier
     * - choiceMaxOccurs: 1
     * - choiceMinOccurs: 1
     * - maxOccurs: unbounded
     * - minOccurs: 1
     * @var \\Losc\CucmBundle\Model\Webservice\StructType\XPhoneLine[]
     */
    public $line;
    /**
     * The lineIdentifier
     * Meta information extracted from the WSDL
     * - documentation: The lineIdentifier is a shorthand method that refers to a particular directory number.
     * - choice: line | lineIdentifier
     * - choiceMaxOccurs: 1
     * - choiceMinOccurs: 1
     * - maxOccurs: unbounded
     * - minOccurs: 1
     * @var \\Losc\CucmBundle\Model\Webservice\StructType\XNumplanIdentifier[]
     */
    public $lineIdentifier;
    /**
     * Constructor method for addLines
     * @uses AddLines::setLine()
     * @uses AddLines::setLineIdentifier()
     * @param \\Losc\CucmBundle\Model\Webservice\StructType\XPhoneLine[] $line
     * @param \\Losc\CucmBundle\Model\Webservice\StructType\XNumplanIdentifier[] $lineIdentifier
     */
    public function __construct(array $line = array(), array $lineIdentifier = array())
    {
        $this
            ->setLine($line)
            ->setLineIdentifier($lineIdentifier);
    }
    /**
     * Get line value
     * @return \\Losc\CucmBundle\Model\Webservice\StructType\XPhoneLine[]
     */
    public function getLine()
    {
        return isset($this->line) ? $this->line : null;
    }
    /**
     * Set line value
     * This property belongs to a choice that allows only one property to exist. It is
     * therefore removable from the request, consequently if the value assigned to this
     * property is null, the property is removed from this object
     * @param \\Losc\CucmBundle\Model\Webservice\StructType\XPhoneLine[] $line
     * @return \\Losc\CucmBundle\Model\Webservice\StructType\AddLines
     */
    public function setLine(array $line = array())
    {
        if (is_null($line) || (is_array($line) && empty($line))) {
            unset($this->line);
        } else {
            $this->line = $line;
        }
        return $this;
    }
    /**
     * Add item to line value
     * @throws \InvalidArgumentException
     * @param \\Losc\CucmBundle\Model\Webservice\StructType\XPhoneLine $item
     * @return \\Losc\CucmBundle\Model\Webservice\StructType\AddLines
     */
    public function addToLine(\\Losc\CucmBundle\Model\Webservice\StructType\XPhoneLine $item)
    {
        $this->line[] = $item;
        return $this;
    }
    /**
     * Get lineIdentifier value
     * @return \\Losc\CucmBundle\Model\Webservice\StructType\XNumplanIdentifier[]
     */
    public function getLineIdentifier()
    {
        return isset($this->lineIdentifier) ? $this->lineIdentifier : null;
    }
    /**
     * Set lineIdentifier value
     * This property belongs to a choice that allows only one property to exist. It is
     * therefore removable from the request, consequently if the value assigned to this
     * property is null, the property is removed from this object
     * @param \\Losc\CucmBundle\Model\Webservice\StructType\XNumplanIdentifier[] $lineIdentifier
     * @return \\Losc\CucmBundle\Model\Webservice\StructType\AddLines
     */
    public function setLineIdentifier(array $lineIdentifier = array())
    {
        if (is_null($lineIdentifier) || (is_array($lineIdentifier) && empty($lineIdentifier))) {
            unset($this->lineIdentifier);
        } else {
            $this->lineIdentifier = $lineIdentifier;
        }
        return $this;
    }
    /**
     * Add item to lineIdentifier value
     * @throws \InvalidArgumentException
     * @param \\Losc\CucmBundle\Model\Webservice\StructType\XNumplanIdentifier $item
     * @return \\Losc\CucmBundle\Model\Webservice\StructType\AddLines
     */
    public function addToLineIdentifier(\\Losc\CucmBundle\Model\Webservice\StructType\XNumplanIdentifier $item)
    {
        $this->lineIdentifier[] = $item;
        return $this;
    }
}
