public static function createFromDataModel(VariableDeclaration $variableDeclaration)
    {
        $variable = parent::createFromDataModel($variableDeclaration);

        if ($variableDeclaration instanceof TemplateDeclaration) {

            $variable->setParamVariable($variableDeclaration->isParamVariable());
            $variable->setMathVariable($variableDeclaration->isMathVariable());

            return $variable;
        } else {
            $msg = "TemplateVariable::createFromDataModel only accept 'qtism\\data\\state\\TemplateVariable' objects, '" . get_class($variableDeclaration) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }