protected function unmarshall(DOMElement $element)
    {
        $mapEntriesElts = $this->getChildElementsByTagName($element, 'mapEntry');
        $mapEntries = new MapEntryCollection();

        foreach ($mapEntriesElts as $mapEntryElt) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($mapEntryElt, array($this->getBaseType()));
            $mapEntries[] = $marshaller->unmarshall($mapEntryElt);
        }

        try {
            $object = new Mapping($mapEntries);

            if (($defaultValue = $this->getDOMElementAttributeAs($element, 'defaultValue', 'float')) !== null) {
                $object->setDefaultValue($defaultValue);
            }

            if (($lowerBound = $this->getDOMElementAttributeAs($element, 'lowerBound', 'float')) !== null) {
                $object->setLowerBound($lowerBound);
            }

            if (($upperBound = $this->getDOMElementAttributeAs($element, 'upperBound', 'float')) !== null) {
                $object->setUpperBound($upperBound);
            }

            return $object;
        } catch (InvalidArgumentException $e) {
            $msg = "A 'mapping' element must contain at least one 'mapEntry' element. None found";
            throw new UnmarshallingException($msg, $element, $e);
        }
    }
protected function unmarshall(DOMElement $element)
    {
        $mapEntriesElts = $this->getChildElementsByTagName($element, 'mapEntry');
        $mapEntries = new MapEntryCollection();

        foreach ($mapEntriesElts as $mapEntryElt) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($mapEntryElt, array($this->getBaseType()));
            $mapEntries[] = $marshaller->unmarshall($mapEntryElt);
        }

        try {
            $object = new Mapping($mapEntries);

            if (($defaultValue = $this->getDOMElementAttributeAs($element, 'defaultValue', 'float')) !== null) {
                $object->setDefaultValue($defaultValue);
            }

            if (($lowerBound = $this->getDOMElementAttributeAs($element, 'lowerBound', 'float')) !== null) {
                $object->setLowerBound($lowerBound);
            }

            if (($upperBound = $this->getDOMElementAttributeAs($element, 'upperBound', 'float')) !== null) {
                $object->setUpperBound($upperBound);
            }

            return $object;
        } catch (InvalidArgumentException $e) {
            $msg = "A 'mapping' element must contain at least one 'mapEntry' element. None found";
            throw new UnmarshallingException($msg, $element, $e);
        }
    }
protected function unmarshall ( DOMElement $ element ) { $ mapEntriesElts = $ this -> getChildElementsByTagName ( $ element , 'mapEntry' ) ; $ mapEntries = new MapEntryCollection ( ) ; foreach ( $ mapEntriesElts as $ mapEntryElt ) { $ marshaller = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ mapEntryElt , array ( $ this -> getBaseType ( ) ) ) ; $ mapEntries [ ] = $ marshaller -> unmarshall ( $ mapEntryElt ) ; } try { $ object = new Mapping ( $ mapEntries ) ; if ( ( $ defaultValue = $ this -> getDOMElementAttributeAs ( $ element , 'defaultValue' , 'float' ) ) !== null ) { $ object -> setDefaultValue ( $ defaultValue ) ; } if ( ( $ lowerBound = $ this -> getDOMElementAttributeAs ( $ element , 'lowerBound' , 'float' ) ) !== null ) { $ object -> setLowerBound ( $ lowerBound ) ; } if ( ( $ upperBound = $ this -> getDOMElementAttributeAs ( $ element , 'upperBound' , 'float' ) ) !== null ) { $ object -> setUpperBound ( $ upperBound ) ; } return $ object ; } catch ( InvalidArgumentException $ e ) { $ msg = "A 'mapping' element must contain at least one 'mapEntry' element. None found" ; throw new UnmarshallingException ( $ msg , $ element , $ e ) ; } }
Unmarshall a DOMElement object corresponding to a QTI mapping element.

@param \DOMElement $element A DOMElement object.
@return \qtism\data\QtiComponent A Mapping object.
@throws \qtism\data\storage\xml\marshalling\UnmarshallingException
Unmarshall a DOMElement object corresponding to a QTI mapping element .