<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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