<?php

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

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for customUserFields StructType
 * @subpackage Structs
 */
class CustomUserFields extends AbstractStructBase
{
    /**
     * The customUserField
     * Meta information extracted from the WSDL
     * - documentation: This Tag is valid only for GetUser
     * - choice: customUserField | customUserField | customUserField
     * - choiceMaxOccurs: 1
     * - choiceMinOccurs: 0
     * - maxOccurs: 5
     * - minOccurs: 0
     * @var \\Losc\CucmBundle\Model\Webservice\StructType\XUserCustomUserField[]
     */
    public $customUserField;
    /**
     * Constructor method for customUserFields
     * @uses CustomUserFields::setCustomUserField()
     * @param \\Losc\CucmBundle\Model\Webservice\StructType\XUserCustomUserField[] $customUserField
     */
    public function __construct(array $customUserField = array())
    {
        $this
            ->setCustomUserField($customUserField);
    }
    /**
     * Get customUserField value
     * @return \\Losc\CucmBundle\Model\Webservice\StructType\XUserCustomUserField[]|null
     */
    public function getCustomUserField()
    {
        return isset($this->customUserField) ? $this->customUserField : null;
    }
    /**
     * Set customUserField 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\XUserCustomUserField[] $customUserField
     * @return \\Losc\CucmBundle\Model\Webservice\StructType\CustomUserFields
     */
    public function setCustomUserField(array $customUserField = array())
    {
        if (is_null($customUserField) || (is_array($customUserField) && empty($customUserField))) {
            unset($this->customUserField);
        } else {
            $this->customUserField = $customUserField;
        }
        return $this;
    }
    /**
     * Add item to customUserField value
     * @throws \InvalidArgumentException
     * @param \\Losc\CucmBundle\Model\Webservice\StructType\XUserCustomUserField $item
     * @return \\Losc\CucmBundle\Model\Webservice\StructType\CustomUserFields
     */
    public function addToCustomUserField(\\Losc\CucmBundle\Model\Webservice\StructType\XUserCustomUserField $item)
    {
        $this->customUserField[] = $item;
        return $this;
    }
}
