protected function unmarshall(DOMElement $element)
    {
        $matchTableEntryElements = $element->getElementsByTagName('matchTableEntry');
        if ($matchTableEntryElements->length > 0) {
            $matchTableEntries = new MatchTableEntryCollection();

            for ($i = 0; $i < $matchTableEntryElements->length; $i++) {
                $marshaller = $this->getMarshallerFactory()->createMarshaller($matchTableEntryElements->item($i), array($this->getBaseType()));
                $matchTableEntries[] = $marshaller->unmarshall($matchTableEntryElements->item($i));
            }

            $object = new MatchTable($matchTableEntries);

            if (($defaultValue = $this->getDOMElementAttributeAs($element, 'defaultValue')) !== null) {
                try {
                    $defaultValue = Utils::stringToDatatype($defaultValue, $this->getBaseType());
                    $object->setDefaultValue($defaultValue);
                } catch (InvalidArgumentException $e) {
                    $strType = BaseType::getNameByConstant($this->getBaseType());
                    $msg = "Unable to transform '$defaultValue' in a ${strType}.";
                    throw new UnmarshallingException($msg, $element, $e);
                }
            }

            return $object;
        } else {
            $msg = "A QTI matchTable element must contain at least one matchTableEntry element.";
            throw new UnmarshallingException($msg, $element);
        }
    }
protected function unmarshall(DOMElement $element)
    {
        $matchTableEntryElements = $element->getElementsByTagName('matchTableEntry');
        if ($matchTableEntryElements->length > 0) {
            $matchTableEntries = new MatchTableEntryCollection();

            for ($i = 0; $i < $matchTableEntryElements->length; $i++) {
                $marshaller = $this->getMarshallerFactory()->createMarshaller($matchTableEntryElements->item($i), array($this->getBaseType()));
                $matchTableEntries[] = $marshaller->unmarshall($matchTableEntryElements->item($i));
            }

            $object = new MatchTable($matchTableEntries);

            if (($defaultValue = $this->getDOMElementAttributeAs($element, 'defaultValue')) !== null) {
                try {
                    $defaultValue = Utils::stringToDatatype($defaultValue, $this->getBaseType());
                    $object->setDefaultValue($defaultValue);
                } catch (InvalidArgumentException $e) {
                    $strType = BaseType::getNameByConstant($this->getBaseType());
                    $msg = "Unable to transform '$defaultValue' in a ${strType}.";
                    throw new UnmarshallingException($msg, $element, $e);
                }
            }

            return $object;
        } else {
            $msg = "A QTI matchTable element must contain at least one matchTableEntry element.";
            throw new UnmarshallingException($msg, $element);
        }
    }
protected function unmarshall ( DOMElement $ element ) { $ matchTableEntryElements = $ element -> getElementsByTagName ( 'matchTableEntry' ) ; if ( $ matchTableEntryElements -> length > 0 ) { $ matchTableEntries = new MatchTableEntryCollection ( ) ; for ( $ i = 0 ; $ i < $ matchTableEntryElements -> length ; $ i ++ ) { $ marshaller = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ matchTableEntryElements -> item ( $ i ) , array ( $ this -> getBaseType ( ) ) ) ; $ matchTableEntries [ ] = $ marshaller -> unmarshall ( $ matchTableEntryElements -> item ( $ i ) ) ; } $ object = new MatchTable ( $ matchTableEntries ) ; if ( ( $ defaultValue = $ this -> getDOMElementAttributeAs ( $ element , 'defaultValue' ) ) !== null ) { try { $ defaultValue = Utils :: stringToDatatype ( $ defaultValue , $ this -> getBaseType ( ) ) ; $ object -> setDefaultValue ( $ defaultValue ) ; } catch ( InvalidArgumentException $ e ) { $ strType = BaseType :: getNameByConstant ( $ this -> getBaseType ( ) ) ; $ msg = "Unable to transform '$defaultValue' in a ${strType}." ; throw new UnmarshallingException ( $ msg , $ element , $ e ) ; } } return $ object ; } else { $ msg = "A QTI matchTable element must contain at least one matchTableEntry element." ; throw new UnmarshallingException ( $ msg , $ element ) ; } }
Unmarshall a DOMElement object corresponding to a QTI MatchTable element.

@param \DOMElement $element A DOMElement object.
@return \qtism\data\QtiComponent A MatchTable object.
@throws \UnmarshallingException If the $element to unmarshall has no matchTableEntry children.
Unmarshall a DOMElement object corresponding to a QTI MatchTable element .