<?php

/**
 * Lifestyle Webconsulting GmbH
 *
 * LICENSE: This Software is the property of Lifestyle Webconsulting GmbH (Aschaffenburg, Germany)
 * and is private by copyright law - it is NOT Freeware.
 *
 * Any unauthorized use of this software without a valid license
 * is a violation of the license agreement and will be prosecuted by
 * civil and criminal law.
 *
 * @copyright  2018 Lifestyle Webconsulting GmbH
 * @link       http://www.life-style.de
 */

namespace Sso\RestBundle\ModelRest\Request\UserWs\Version1\UserService\PasswordRequest;

use Doctrine\Common\Collections\ArrayCollection;
use JMS\Serializer\Annotation as Serializer;

/**
 * Class UserPasswordRequest
 *
 * @Serializer\XmlRoot("userPasswordRequest")
 *
 * @copyright  2016 Lifestyle Webconsulting GmbH
 * @link       http://www.life-style.de
 * @package    Sso\RestBundle\ModelRest\Request\UserWs\Version1\UserService\PasswordRequest
 */
class UserPasswordRequest
{
    /**
     * @Serializer\SerializedName("userType")
     * @Serializer\Type("ArrayCollection<Sso\RestBundle\ModelRest\Request\UserWs\Version1\UserService\PasswordRequest\UserType>")
     * @Serializer\XmlList(inline=true, entry="userType")
     *
     * @var UserType[]|ArrayCollection
     */
    private $userType;

    /**
     * @return UserType[]|ArrayCollection
     */
    public function getUserType()
    {
        return $this->userType;
    }

    /**
     * @param UserType $userType
     */
    public function addUserType(UserType $userType)
    {
        if (!$this->userType) {
            $this->userType = new ArrayCollection();
        }

        if (!$this->userType->contains($userType)) {
            $this->userType->add($userType);
        }
    }
}
