<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for BooleanCustomFieldRef StructType
 * @subpackage Structs
 */
class BooleanCustomFieldRef extends CustomFieldRef
{
    /**
     * The value
     * @var bool
     */
    public $value;
    /**
     * Constructor method for BooleanCustomFieldRef
     * @uses BooleanCustomFieldRef::setValue()
     * @param bool $value
     */
    public function __construct($value = null)
    {
        $this
            ->setValue($value);
    }
    /**
     * Get value value
     * @return bool|null
     */
    public function getValue()
    {
        return $this->value;
    }
    /**
     * Set value value
     * @param bool $value
     * @return \StructType\BooleanCustomFieldRef
     */
    public function setValue($value = null)
    {
        // validation for constraint: boolean
        if (!is_null($value) && !is_bool($value)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($value, true), gettype($value)), __LINE__);
        }
        $this->value = $value;
        return $this;
    }
}
