public function setValue(QtiDatatype $value = null)
    {
        if (Utils::isBaseTypeCompliant($this->getBaseType(), $value) && Utils::isCardinalityCompliant($this->getCardinality(), $value)) {
            $this->value = $value;
        } else {
            Utils::throwBaseTypeTypingError($this->baseType, $value);
        }
    }
public function setValue(QtiDatatype $value = null)
    {
        if (Utils::isBaseTypeCompliant($this->getBaseType(), $value) && Utils::isCardinalityCompliant($this->getCardinality(), $value)) {
            $this->value = $value;
        } else {
            Utils::throwBaseTypeTypingError($this->baseType, $value);
        }
    }
public function setValue ( QtiDatatype $ value = null ) { if ( Utils :: isBaseTypeCompliant ( $ this -> getBaseType ( ) , $ value ) && Utils :: isCardinalityCompliant ( $ this -> getCardinality ( ) , $ value ) ) { $ this -> value = $ value ; } else { Utils :: throwBaseTypeTypingError ( $ this -> baseType , $ value ) ; } }
Set the value of the Variable.

@param \qtism\common\datatypes\QtiDatatype|null $value A QtiDatatype object or null.
@throws \InvalidArgumentException If the baseType and cardinality of $value are not compliant with the Variable.
Set the value of the Variable .