<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for
 * BizAction.Security.CrossOrgUnits.ChangeDefaults.RequestItem StructType
 * @subpackage Structs
 */
class BizAction_Security_CrossOrgUnits_ChangeDefaults_RequestItem extends BizAction_Security_CrossOrgUnits_RequestItemBase
{
    /**
     * The IsMyself
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var bool
     */
    public $IsMyself;
    /**
     * The IsSalesAllowed
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $IsSalesAllowed;
    /**
     * The IsSearchAllowed
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $IsSearchAllowed;
    /**
     * The IsSellNonAllocatedSeatsAllowed
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $IsSellNonAllocatedSeatsAllowed;
    /**
     * Constructor method for
     * BizAction.Security.CrossOrgUnits.ChangeDefaults.RequestItem
     * @uses BizAction_Security_CrossOrgUnits_ChangeDefaults_RequestItem::setIsMyself()
     * @uses BizAction_Security_CrossOrgUnits_ChangeDefaults_RequestItem::setIsSalesAllowed()
     * @uses BizAction_Security_CrossOrgUnits_ChangeDefaults_RequestItem::setIsSearchAllowed()
     * @uses BizAction_Security_CrossOrgUnits_ChangeDefaults_RequestItem::setIsSellNonAllocatedSeatsAllowed()
     * @param bool $isMyself
     * @param int $isSalesAllowed
     * @param int $isSearchAllowed
     * @param int $isSellNonAllocatedSeatsAllowed
     */
    public function __construct($isMyself = null, $isSalesAllowed = null, $isSearchAllowed = null, $isSellNonAllocatedSeatsAllowed = null)
    {
        $this
            ->setIsMyself($isMyself)
            ->setIsSalesAllowed($isSalesAllowed)
            ->setIsSearchAllowed($isSearchAllowed)
            ->setIsSellNonAllocatedSeatsAllowed($isSellNonAllocatedSeatsAllowed);
    }
    /**
     * Get IsMyself 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 getIsMyself()
    {
        return isset($this->IsMyself) ? $this->IsMyself : null;
    }
    /**
     * Set IsMyself 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 $isMyself
     * @return \patest\StructType\BizAction_Security_CrossOrgUnits_ChangeDefaults_RequestItem
     */
    public function setIsMyself($isMyself = null)
    {
        // validation for constraint: boolean
        if (!is_null($isMyself) && !is_bool($isMyself)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($isMyself, true), gettype($isMyself)), __LINE__);
        }
        if (is_null($isMyself) || (is_array($isMyself) && empty($isMyself))) {
            unset($this->IsMyself);
        } else {
            $this->IsMyself = $isMyself;
        }
        return $this;
    }
    /**
     * Get IsSalesAllowed 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 getIsSalesAllowed()
    {
        return isset($this->IsSalesAllowed) ? $this->IsSalesAllowed : null;
    }
    /**
     * Set IsSalesAllowed 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 $isSalesAllowed
     * @return \patest\StructType\BizAction_Security_CrossOrgUnits_ChangeDefaults_RequestItem
     */
    public function setIsSalesAllowed($isSalesAllowed = null)
    {
        // validation for constraint: int
        if (!is_null($isSalesAllowed) && !(is_int($isSalesAllowed) || ctype_digit($isSalesAllowed))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($isSalesAllowed, true), gettype($isSalesAllowed)), __LINE__);
        }
        if (is_null($isSalesAllowed) || (is_array($isSalesAllowed) && empty($isSalesAllowed))) {
            unset($this->IsSalesAllowed);
        } else {
            $this->IsSalesAllowed = $isSalesAllowed;
        }
        return $this;
    }
    /**
     * Get IsSearchAllowed 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 getIsSearchAllowed()
    {
        return isset($this->IsSearchAllowed) ? $this->IsSearchAllowed : null;
    }
    /**
     * Set IsSearchAllowed 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 $isSearchAllowed
     * @return \patest\StructType\BizAction_Security_CrossOrgUnits_ChangeDefaults_RequestItem
     */
    public function setIsSearchAllowed($isSearchAllowed = null)
    {
        // validation for constraint: int
        if (!is_null($isSearchAllowed) && !(is_int($isSearchAllowed) || ctype_digit($isSearchAllowed))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($isSearchAllowed, true), gettype($isSearchAllowed)), __LINE__);
        }
        if (is_null($isSearchAllowed) || (is_array($isSearchAllowed) && empty($isSearchAllowed))) {
            unset($this->IsSearchAllowed);
        } else {
            $this->IsSearchAllowed = $isSearchAllowed;
        }
        return $this;
    }
    /**
     * Get IsSellNonAllocatedSeatsAllowed 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 getIsSellNonAllocatedSeatsAllowed()
    {
        return isset($this->IsSellNonAllocatedSeatsAllowed) ? $this->IsSellNonAllocatedSeatsAllowed : null;
    }
    /**
     * Set IsSellNonAllocatedSeatsAllowed 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 $isSellNonAllocatedSeatsAllowed
     * @return \patest\StructType\BizAction_Security_CrossOrgUnits_ChangeDefaults_RequestItem
     */
    public function setIsSellNonAllocatedSeatsAllowed($isSellNonAllocatedSeatsAllowed = null)
    {
        // validation for constraint: int
        if (!is_null($isSellNonAllocatedSeatsAllowed) && !(is_int($isSellNonAllocatedSeatsAllowed) || ctype_digit($isSellNonAllocatedSeatsAllowed))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($isSellNonAllocatedSeatsAllowed, true), gettype($isSellNonAllocatedSeatsAllowed)), __LINE__);
        }
        if (is_null($isSellNonAllocatedSeatsAllowed) || (is_array($isSellNonAllocatedSeatsAllowed) && empty($isSellNonAllocatedSeatsAllowed))) {
            unset($this->IsSellNonAllocatedSeatsAllowed);
        } else {
            $this->IsSellNonAllocatedSeatsAllowed = $isSellNonAllocatedSeatsAllowed;
        }
        return $this;
    }
}
