<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_AlternateReceiptType StructType
 * @subpackage Structs
 */
class JP_AlternateReceiptType extends AbstractStructBase
{
    /**
     * The Id
     * Meta information extracted from the WSDL
     * - use: required
     * @var int
     */
    public $Id;
    /**
     * The Name
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $Name;
    /**
     * The UserFields
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \ArrayType\ArrayOfJP_AlternateReceiptField
     */
    public $UserFields;
    /**
     * Constructor method for JP_AlternateReceiptType
     * @uses JP_AlternateReceiptType::setId()
     * @uses JP_AlternateReceiptType::setName()
     * @uses JP_AlternateReceiptType::setUserFields()
     * @param int $id
     * @param string $name
     * @param \ArrayType\ArrayOfJP_AlternateReceiptField $userFields
     */
    public function __construct($id = null, $name = null, \ArrayType\ArrayOfJP_AlternateReceiptField $userFields = null)
    {
        $this
            ->setId($id)
            ->setName($name)
            ->setUserFields($userFields);
    }
    /**
     * Get Id value
     * @return int
     */
    public function getId()
    {
        return $this->Id;
    }
    /**
     * Set Id value
     * @param int $id
     * @return \StructType\JP_AlternateReceiptType
     */
    public function setId($id = null)
    {
        // validation for constraint: int
        if (!is_null($id) && !(is_int($id) || ctype_digit($id))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($id, true), gettype($id)), __LINE__);
        }
        $this->Id = $id;
        return $this;
    }
    /**
     * Get Name value
     * @return string|null
     */
    public function getName()
    {
        return $this->Name;
    }
    /**
     * Set Name value
     * @param string $name
     * @return \StructType\JP_AlternateReceiptType
     */
    public function setName($name = null)
    {
        // validation for constraint: string
        if (!is_null($name) && !is_string($name)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__);
        }
        $this->Name = $name;
        return $this;
    }
    /**
     * Get UserFields value
     * @return \ArrayType\ArrayOfJP_AlternateReceiptField|null
     */
    public function getUserFields()
    {
        return $this->UserFields;
    }
    /**
     * Set UserFields value
     * @param \ArrayType\ArrayOfJP_AlternateReceiptField $userFields
     * @return \StructType\JP_AlternateReceiptType
     */
    public function setUserFields(\ArrayType\ArrayOfJP_AlternateReceiptField $userFields = null)
    {
        $this->UserFields = $userFields;
        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 \StructType\JP_AlternateReceiptType
     */
    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__;
    }
}
