protected function unmarshall(DOMElement $element)
    {
        if (($name = $this->getDOMElementAttributeAs($element, 'name')) !== null) {
            if (($cst = MathEnumeration::getConstantByName($name)) !== false) {
                $object = new MathConstant($cst);

                return $object;
            } else {
                $msg = "'${name}' is not a valid value for the attribute 'name' from element '" . $element->localName . "'.";
                throw new UnmarshallingException($msg, $element);
            }
        } else {
            $msg = "The mandatory attribute 'name' is missing from element '" . $element->localName . "'.";
            throw new UnmarshallingException($msg, $element);
        }
    }
protected function unmarshall(DOMElement $element)
    {
        if (($name = $this->getDOMElementAttributeAs($element, 'name')) !== null) {
            if (($cst = MathEnumeration::getConstantByName($name)) !== false) {
                $object = new MathConstant($cst);

                return $object;
            } else {
                $msg = "'${name}' is not a valid value for the attribute 'name' from element '" . $element->localName . "'.";
                throw new UnmarshallingException($msg, $element);
            }
        } else {
            $msg = "The mandatory attribute 'name' is missing from element '" . $element->localName . "'.";
            throw new UnmarshallingException($msg, $element);
        }
    }
protected function unmarshall ( DOMElement $ element ) { if ( ( $ name = $ this -> getDOMElementAttributeAs ( $ element , 'name' ) ) !== null ) { if ( ( $ cst = MathEnumeration :: getConstantByName ( $ name ) ) !== false ) { $ object = new MathConstant ( $ cst ) ; return $ object ; } else { $ msg = "'${name}' is not a valid value for the attribute 'name' from element '" . $ element -> localName . "'." ; throw new UnmarshallingException ( $ msg , $ element ) ; } } else { $ msg = "The mandatory attribute 'name' is missing from element '" . $ element -> localName . "'." ; throw new UnmarshallingException ( $ msg , $ element ) ; } }
Unmarshall a DOMElement object corresponding to a QTI mathConstant element.

@param \DOMElement $element A DOMElement object.
@return \qtism\data\QtiComponent A MathConstant object.
@throws \UnmarshallingException If the mandatory attribute 'name' is missing.
Unmarshall a DOMElement object corresponding to a QTI mathConstant element .