/** * Apply the default value to the OutcomeVariable. * * If no default value is described, and the cardinality is single and the baseType * is integer or float, the value of the variable becomes 0. * */ public function applyDefaultValue() { parent::applyDefaultValue(); if (is_null($this->getDefaultValue()) === true && $this->getCardinality() === Cardinality::SINGLE) { if ($this->getBaseType() === BaseType::INTEGER) { $this->setValue(new Integer(0)); } else { if ($this->getBaseType() === BaseType::FLOAT) { $this->setValue(new Float(0.0)); } } } }