<?php

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

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for units StructType
 * Meta information extracted from the WSDL
 * - documentation: The units element is optional when a newVG224 is being added and can be added using updateVG224Gateway.
 * @subpackage Structs
 */
class Units extends AbstractStructBase
{
    /**
     * The unit
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \\Losc\CucmBundle\Model\Webservice\StructType\Unit[]
     */
    public $unit;
    /**
     * Constructor method for units
     * @uses Units::setUnit()
     * @param \\Losc\CucmBundle\Model\Webservice\StructType\Unit[] $unit
     */
    public function __construct(array $unit = array())
    {
        $this
            ->setUnit($unit);
    }
    /**
     * Get unit value
     * @return \\Losc\CucmBundle\Model\Webservice\StructType\Unit[]|null
     */
    public function getUnit()
    {
        return $this->unit;
    }
    /**
     * Set unit value
     * @param \\Losc\CucmBundle\Model\Webservice\StructType\Unit[] $unit
     * @return \\Losc\CucmBundle\Model\Webservice\StructType\Units
     */
    public function setUnit(array $unit = array())
    {
        $this->unit = $unit;
        return $this;
    }
    /**
     * Add item to unit value
     * @throws \InvalidArgumentException
     * @param \\Losc\CucmBundle\Model\Webservice\StructType\Unit $item
     * @return \\Losc\CucmBundle\Model\Webservice\StructType\Units
     */
    public function addToUnit(\\Losc\CucmBundle\Model\Webservice\StructType\Unit $item)
    {
        $this->unit[] = $item;
        return $this;
    }
}
