<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Sales.LimitSameMembershipPerOwnerEntity StructType
 * @subpackage Structs
 */
class Sales_LimitSameMembershipPerOwnerEntity extends AnyEntity
{
    /**
     * The CheckAcrossLevel
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var bool
     */
    public $CheckAcrossLevel;
    /**
     * The CheckClientHistory
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var bool
     */
    public $CheckClientHistory;
    /**
     * The CountFrozenMembership
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var bool
     */
    public $CountFrozenMembership;
    /**
     * The CountReservedMembership
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var bool
     */
    public $CountReservedMembership;
    /**
     * The LimitAlsoForUpgrade
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var bool
     */
    public $LimitAlsoForUpgrade;
    /**
     * The MaxMembershipInstances
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $MaxMembershipInstances;
    /**
     * Constructor method for Sales.LimitSameMembershipPerOwnerEntity
     * @uses Sales_LimitSameMembershipPerOwnerEntity::setCheckAcrossLevel()
     * @uses Sales_LimitSameMembershipPerOwnerEntity::setCheckClientHistory()
     * @uses Sales_LimitSameMembershipPerOwnerEntity::setCountFrozenMembership()
     * @uses Sales_LimitSameMembershipPerOwnerEntity::setCountReservedMembership()
     * @uses Sales_LimitSameMembershipPerOwnerEntity::setLimitAlsoForUpgrade()
     * @uses Sales_LimitSameMembershipPerOwnerEntity::setMaxMembershipInstances()
     * @param bool $checkAcrossLevel
     * @param bool $checkClientHistory
     * @param bool $countFrozenMembership
     * @param bool $countReservedMembership
     * @param bool $limitAlsoForUpgrade
     * @param int $maxMembershipInstances
     */
    public function __construct($checkAcrossLevel = null, $checkClientHistory = null, $countFrozenMembership = null, $countReservedMembership = null, $limitAlsoForUpgrade = null, $maxMembershipInstances = null)
    {
        $this
            ->setCheckAcrossLevel($checkAcrossLevel)
            ->setCheckClientHistory($checkClientHistory)
            ->setCountFrozenMembership($countFrozenMembership)
            ->setCountReservedMembership($countReservedMembership)
            ->setLimitAlsoForUpgrade($limitAlsoForUpgrade)
            ->setMaxMembershipInstances($maxMembershipInstances);
    }
    /**
     * Get CheckAcrossLevel value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return bool|null
     */
    public function getCheckAcrossLevel()
    {
        return isset($this->CheckAcrossLevel) ? $this->CheckAcrossLevel : null;
    }
    /**
     * Set CheckAcrossLevel value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param bool $checkAcrossLevel
     * @return \patest\StructType\Sales_LimitSameMembershipPerOwnerEntity
     */
    public function setCheckAcrossLevel($checkAcrossLevel = null)
    {
        // validation for constraint: boolean
        if (!is_null($checkAcrossLevel) && !is_bool($checkAcrossLevel)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($checkAcrossLevel, true), gettype($checkAcrossLevel)), __LINE__);
        }
        if (is_null($checkAcrossLevel) || (is_array($checkAcrossLevel) && empty($checkAcrossLevel))) {
            unset($this->CheckAcrossLevel);
        } else {
            $this->CheckAcrossLevel = $checkAcrossLevel;
        }
        return $this;
    }
    /**
     * Get CheckClientHistory value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return bool|null
     */
    public function getCheckClientHistory()
    {
        return isset($this->CheckClientHistory) ? $this->CheckClientHistory : null;
    }
    /**
     * Set CheckClientHistory value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param bool $checkClientHistory
     * @return \patest\StructType\Sales_LimitSameMembershipPerOwnerEntity
     */
    public function setCheckClientHistory($checkClientHistory = null)
    {
        // validation for constraint: boolean
        if (!is_null($checkClientHistory) && !is_bool($checkClientHistory)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($checkClientHistory, true), gettype($checkClientHistory)), __LINE__);
        }
        if (is_null($checkClientHistory) || (is_array($checkClientHistory) && empty($checkClientHistory))) {
            unset($this->CheckClientHistory);
        } else {
            $this->CheckClientHistory = $checkClientHistory;
        }
        return $this;
    }
    /**
     * Get CountFrozenMembership value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return bool|null
     */
    public function getCountFrozenMembership()
    {
        return isset($this->CountFrozenMembership) ? $this->CountFrozenMembership : null;
    }
    /**
     * Set CountFrozenMembership value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param bool $countFrozenMembership
     * @return \patest\StructType\Sales_LimitSameMembershipPerOwnerEntity
     */
    public function setCountFrozenMembership($countFrozenMembership = null)
    {
        // validation for constraint: boolean
        if (!is_null($countFrozenMembership) && !is_bool($countFrozenMembership)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($countFrozenMembership, true), gettype($countFrozenMembership)), __LINE__);
        }
        if (is_null($countFrozenMembership) || (is_array($countFrozenMembership) && empty($countFrozenMembership))) {
            unset($this->CountFrozenMembership);
        } else {
            $this->CountFrozenMembership = $countFrozenMembership;
        }
        return $this;
    }
    /**
     * Get CountReservedMembership value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return bool|null
     */
    public function getCountReservedMembership()
    {
        return isset($this->CountReservedMembership) ? $this->CountReservedMembership : null;
    }
    /**
     * Set CountReservedMembership value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param bool $countReservedMembership
     * @return \patest\StructType\Sales_LimitSameMembershipPerOwnerEntity
     */
    public function setCountReservedMembership($countReservedMembership = null)
    {
        // validation for constraint: boolean
        if (!is_null($countReservedMembership) && !is_bool($countReservedMembership)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($countReservedMembership, true), gettype($countReservedMembership)), __LINE__);
        }
        if (is_null($countReservedMembership) || (is_array($countReservedMembership) && empty($countReservedMembership))) {
            unset($this->CountReservedMembership);
        } else {
            $this->CountReservedMembership = $countReservedMembership;
        }
        return $this;
    }
    /**
     * Get LimitAlsoForUpgrade value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return bool|null
     */
    public function getLimitAlsoForUpgrade()
    {
        return isset($this->LimitAlsoForUpgrade) ? $this->LimitAlsoForUpgrade : null;
    }
    /**
     * Set LimitAlsoForUpgrade value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param bool $limitAlsoForUpgrade
     * @return \patest\StructType\Sales_LimitSameMembershipPerOwnerEntity
     */
    public function setLimitAlsoForUpgrade($limitAlsoForUpgrade = null)
    {
        // validation for constraint: boolean
        if (!is_null($limitAlsoForUpgrade) && !is_bool($limitAlsoForUpgrade)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($limitAlsoForUpgrade, true), gettype($limitAlsoForUpgrade)), __LINE__);
        }
        if (is_null($limitAlsoForUpgrade) || (is_array($limitAlsoForUpgrade) && empty($limitAlsoForUpgrade))) {
            unset($this->LimitAlsoForUpgrade);
        } else {
            $this->LimitAlsoForUpgrade = $limitAlsoForUpgrade;
        }
        return $this;
    }
    /**
     * Get MaxMembershipInstances value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return int|null
     */
    public function getMaxMembershipInstances()
    {
        return isset($this->MaxMembershipInstances) ? $this->MaxMembershipInstances : null;
    }
    /**
     * Set MaxMembershipInstances value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param int $maxMembershipInstances
     * @return \patest\StructType\Sales_LimitSameMembershipPerOwnerEntity
     */
    public function setMaxMembershipInstances($maxMembershipInstances = null)
    {
        // validation for constraint: int
        if (!is_null($maxMembershipInstances) && !(is_int($maxMembershipInstances) || ctype_digit($maxMembershipInstances))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($maxMembershipInstances, true), gettype($maxMembershipInstances)), __LINE__);
        }
        if (is_null($maxMembershipInstances) || (is_array($maxMembershipInstances) && empty($maxMembershipInstances))) {
            unset($this->MaxMembershipInstances);
        } else {
            $this->MaxMembershipInstances = $maxMembershipInstances;
        }
        return $this;
    }
}
