<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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