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

        if ($variableDeclaration instanceof OutcomeDeclaration) {

            $variable->setViews($variableDeclaration->getViews());
            $variable->setNormalMaximum($variableDeclaration->getNormalMaximum());
            $variable->setNormalMinimum($variableDeclaration->getNormalMinimum());
            $variable->setMasteryValue($variableDeclaration->getMasteryValue());
            $variable->setLookupTable($variableDeclaration->getLookupTable());

            return $variable;
        } else {
            $msg = "OutcomeVariable::createFromDataModel only accept 'qtism\\data\\state\\OutcomeDeclaration' objects, '" . get_class($variableDeclaration) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
public static function createFromDataModel(VariableDeclaration $variableDeclaration)
    {
        $variable = parent::createFromDataModel($variableDeclaration);

        if ($variableDeclaration instanceof OutcomeDeclaration) {

            $variable->setViews($variableDeclaration->getViews());
            $variable->setNormalMaximum($variableDeclaration->getNormalMaximum());
            $variable->setNormalMinimum($variableDeclaration->getNormalMinimum());
            $variable->setMasteryValue($variableDeclaration->getMasteryValue());
            $variable->setLookupTable($variableDeclaration->getLookupTable());

            return $variable;
        } else {
            $msg = "OutcomeVariable::createFromDataModel only accept 'qtism\\data\\state\\OutcomeDeclaration' objects, '" . get_class($variableDeclaration) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
public static function createFromDataModel ( VariableDeclaration $ variableDeclaration ) { $ variable = parent :: createFromDataModel ( $ variableDeclaration ) ; if ( $ variableDeclaration instanceof OutcomeDeclaration ) { $ variable -> setViews ( $ variableDeclaration -> getViews ( ) ) ; $ variable -> setNormalMaximum ( $ variableDeclaration -> getNormalMaximum ( ) ) ; $ variable -> setNormalMinimum ( $ variableDeclaration -> getNormalMinimum ( ) ) ; $ variable -> setMasteryValue ( $ variableDeclaration -> getMasteryValue ( ) ) ; $ variable -> setLookupTable ( $ variableDeclaration -> getLookupTable ( ) ) ; return $ variable ; } else { $ msg = "OutcomeVariable::createFromDataModel only accept 'qtism\\data\\state\\OutcomeDeclaration' objects, '" . get_class ( $ variableDeclaration ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Create an OutcomeVariable object from a data model VariableDeclaration object.

@param \qtism\data\state\VariableDeclaration $variableDeclaration
@throws \InvalidArgumentException
@return \qtism\runtime\common\OutcomeVariable
Create an OutcomeVariable object from a data model VariableDeclaration object .