<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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