<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for AccessControl.BarcodeGeneratorConfig.ManuallyEntered
 * StructType
 * @subpackage Structs
 */
class AccessControl_BarcodeGeneratorConfig_ManuallyEntered extends AccessControl_BarcodeGeneratorConfig_BaseEntity
{
    /**
     * The AllowBarcodeReUse
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var bool
     */
    public $AllowBarcodeReUse;
    /**
     * Constructor method for AccessControl.BarcodeGeneratorConfig.ManuallyEntered
     * @uses AccessControl_BarcodeGeneratorConfig_ManuallyEntered::setAllowBarcodeReUse()
     * @param bool $allowBarcodeReUse
     */
    public function __construct($allowBarcodeReUse = null)
    {
        $this
            ->setAllowBarcodeReUse($allowBarcodeReUse);
    }
    /**
     * Get AllowBarcodeReUse 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 getAllowBarcodeReUse()
    {
        return isset($this->AllowBarcodeReUse) ? $this->AllowBarcodeReUse : null;
    }
    /**
     * Set AllowBarcodeReUse 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 $allowBarcodeReUse
     * @return \patest\StructType\AccessControl_BarcodeGeneratorConfig_ManuallyEntered
     */
    public function setAllowBarcodeReUse($allowBarcodeReUse = null)
    {
        // validation for constraint: boolean
        if (!is_null($allowBarcodeReUse) && !is_bool($allowBarcodeReUse)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($allowBarcodeReUse, true), gettype($allowBarcodeReUse)), __LINE__);
        }
        if (is_null($allowBarcodeReUse) || (is_array($allowBarcodeReUse) && empty($allowBarcodeReUse))) {
            unset($this->AllowBarcodeReUse);
        } else {
            $this->AllowBarcodeReUse = $allowBarcodeReUse;
        }
        return $this;
    }
}
