<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for LoyaltyRedemption StructType
 * @package Dg
 * @subpackage Structs
 */
class DgLoyaltyRedemption extends AbstractStructBase
{
    /**
     * The LoyaltyCertificate
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgLoyaltyCertificate[]
     */
    public $LoyaltyCertificate;
    /**
     * The CertificateNumber
     * @var string
     */
    public $CertificateNumber;
    /**
     * The MemberNumber
     * @var string
     */
    public $MemberNumber;
    /**
     * The ProgramName
     * @var string
     */
    public $ProgramName;
    /**
     * The PromotionCode
     * @var string
     */
    public $PromotionCode;
    /**
     * The PromotionVendorCode
     * @var string[]
     */
    public $PromotionVendorCode;
    /**
     * The RedemptionQuantity
     * @var int
     */
    public $RedemptionQuantity;
    /**
     * Constructor method for LoyaltyRedemption
     * @uses DgLoyaltyRedemption::setLoyaltyCertificate()
     * @uses DgLoyaltyRedemption::setCertificateNumber()
     * @uses DgLoyaltyRedemption::setMemberNumber()
     * @uses DgLoyaltyRedemption::setProgramName()
     * @uses DgLoyaltyRedemption::setPromotionCode()
     * @uses DgLoyaltyRedemption::setPromotionVendorCode()
     * @uses DgLoyaltyRedemption::setRedemptionQuantity()
     * @param \dgsoft\StructType\DgLoyaltyCertificate[] $loyaltyCertificate
     * @param string $certificateNumber
     * @param string $memberNumber
     * @param string $programName
     * @param string $promotionCode
     * @param string[] $promotionVendorCode
     * @param int $redemptionQuantity
     */
    public function __construct(array $loyaltyCertificate = array(), $certificateNumber = null, $memberNumber = null, $programName = null, $promotionCode = null, array $promotionVendorCode = array(), $redemptionQuantity = null)
    {
        $this
            ->setLoyaltyCertificate($loyaltyCertificate)
            ->setCertificateNumber($certificateNumber)
            ->setMemberNumber($memberNumber)
            ->setProgramName($programName)
            ->setPromotionCode($promotionCode)
            ->setPromotionVendorCode($promotionVendorCode)
            ->setRedemptionQuantity($redemptionQuantity);
    }
    /**
     * Get LoyaltyCertificate value
     * @return \dgsoft\StructType\DgLoyaltyCertificate[]|null
     */
    public function getLoyaltyCertificate()
    {
        return $this->LoyaltyCertificate;
    }
    /**
     * Set LoyaltyCertificate value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgLoyaltyCertificate[] $loyaltyCertificate
     * @return \dgsoft\StructType\DgLoyaltyRedemption
     */
    public function setLoyaltyCertificate(array $loyaltyCertificate = array())
    {
        foreach ($loyaltyCertificate as $loyaltyRedemptionLoyaltyCertificateItem) {
            // validation for constraint: itemType
            if (!$loyaltyRedemptionLoyaltyCertificateItem instanceof \dgsoft\StructType\DgLoyaltyCertificate) {
                throw new \InvalidArgumentException(sprintf('The LoyaltyCertificate property can only contain items of \dgsoft\StructType\DgLoyaltyCertificate, "%s" given', is_object($loyaltyRedemptionLoyaltyCertificateItem) ? get_class($loyaltyRedemptionLoyaltyCertificateItem) : gettype($loyaltyRedemptionLoyaltyCertificateItem)), __LINE__);
            }
        }
        $this->LoyaltyCertificate = $loyaltyCertificate;
        return $this;
    }
    /**
     * Add item to LoyaltyCertificate value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgLoyaltyCertificate $item
     * @return \dgsoft\StructType\DgLoyaltyRedemption
     */
    public function addToLoyaltyCertificate(\dgsoft\StructType\DgLoyaltyCertificate $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \dgsoft\StructType\DgLoyaltyCertificate) {
            throw new \InvalidArgumentException(sprintf('The LoyaltyCertificate property can only contain items of \dgsoft\StructType\DgLoyaltyCertificate, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->LoyaltyCertificate[] = $item;
        return $this;
    }
    /**
     * Get CertificateNumber value
     * @return string|null
     */
    public function getCertificateNumber()
    {
        return $this->CertificateNumber;
    }
    /**
     * Set CertificateNumber value
     * @param string $certificateNumber
     * @return \dgsoft\StructType\DgLoyaltyRedemption
     */
    public function setCertificateNumber($certificateNumber = null)
    {
        // validation for constraint: string
        if (!is_null($certificateNumber) && !is_string($certificateNumber)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($certificateNumber)), __LINE__);
        }
        $this->CertificateNumber = $certificateNumber;
        return $this;
    }
    /**
     * Get MemberNumber value
     * @return string|null
     */
    public function getMemberNumber()
    {
        return $this->MemberNumber;
    }
    /**
     * Set MemberNumber value
     * @param string $memberNumber
     * @return \dgsoft\StructType\DgLoyaltyRedemption
     */
    public function setMemberNumber($memberNumber = null)
    {
        // validation for constraint: string
        if (!is_null($memberNumber) && !is_string($memberNumber)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($memberNumber)), __LINE__);
        }
        $this->MemberNumber = $memberNumber;
        return $this;
    }
    /**
     * Get ProgramName value
     * @return string|null
     */
    public function getProgramName()
    {
        return $this->ProgramName;
    }
    /**
     * Set ProgramName value
     * @param string $programName
     * @return \dgsoft\StructType\DgLoyaltyRedemption
     */
    public function setProgramName($programName = null)
    {
        // validation for constraint: string
        if (!is_null($programName) && !is_string($programName)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($programName)), __LINE__);
        }
        $this->ProgramName = $programName;
        return $this;
    }
    /**
     * Get PromotionCode value
     * @return string|null
     */
    public function getPromotionCode()
    {
        return $this->PromotionCode;
    }
    /**
     * Set PromotionCode value
     * @param string $promotionCode
     * @return \dgsoft\StructType\DgLoyaltyRedemption
     */
    public function setPromotionCode($promotionCode = null)
    {
        // validation for constraint: string
        if (!is_null($promotionCode) && !is_string($promotionCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($promotionCode)), __LINE__);
        }
        $this->PromotionCode = $promotionCode;
        return $this;
    }
    /**
     * Get PromotionVendorCode value
     * @return string[]|null
     */
    public function getPromotionVendorCode()
    {
        return $this->PromotionVendorCode;
    }
    /**
     * Set PromotionVendorCode value
     * @throws \InvalidArgumentException
     * @param string[] $promotionVendorCode
     * @return \dgsoft\StructType\DgLoyaltyRedemption
     */
    public function setPromotionVendorCode(array $promotionVendorCode = array())
    {
        foreach ($promotionVendorCode as $loyaltyRedemptionPromotionVendorCodeItem) {
            // validation for constraint: itemType
            if (!is_string($loyaltyRedemptionPromotionVendorCodeItem)) {
                throw new \InvalidArgumentException(sprintf('The PromotionVendorCode property can only contain items of string, "%s" given', is_object($loyaltyRedemptionPromotionVendorCodeItem) ? get_class($loyaltyRedemptionPromotionVendorCodeItem) : gettype($loyaltyRedemptionPromotionVendorCodeItem)), __LINE__);
            }
        }
        $this->PromotionVendorCode = $promotionVendorCode;
        return $this;
    }
    /**
     * Add item to PromotionVendorCode value
     * @throws \InvalidArgumentException
     * @param string $item
     * @return \dgsoft\StructType\DgLoyaltyRedemption
     */
    public function addToPromotionVendorCode($item)
    {
        // validation for constraint: itemType
        if (!is_string($item)) {
            throw new \InvalidArgumentException(sprintf('The PromotionVendorCode property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->PromotionVendorCode[] = $item;
        return $this;
    }
    /**
     * Get RedemptionQuantity value
     * @return int|null
     */
    public function getRedemptionQuantity()
    {
        return $this->RedemptionQuantity;
    }
    /**
     * Set RedemptionQuantity value
     * @param int $redemptionQuantity
     * @return \dgsoft\StructType\DgLoyaltyRedemption
     */
    public function setRedemptionQuantity($redemptionQuantity = null)
    {
        // validation for constraint: int
        if (!is_null($redemptionQuantity) && !is_numeric($redemptionQuantity)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($redemptionQuantity)), __LINE__);
        }
        $this->RedemptionQuantity = $redemptionQuantity;
        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 \dgsoft\StructType\DgLoyaltyRedemption
     */
    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__;
    }
}
