protected function marshall(QtiComponent $component)
    {
        $element = static::getDOMCradle()->createElement($component->getQtiClassName());

        $fieldIdentifer = $component->getFieldIdentifier();
        $baseType = $component->getBaseType();

        self::setDOMElementValue($element, $component->getValue());

        if (!empty($fieldIdentifer)) {
            $this->setDOMElementAttribute($element, 'fieldIdentifier', $fieldIdentifer);
        }

        if ($component->isPartOfRecord() && $baseType >= 0) {
            $this->setDOMElementAttribute($element, 'baseType', BaseType::getNameByConstant($baseType));
        }

        return $element;
    }
protected function marshall(QtiComponent $component)
    {
        $element = static::getDOMCradle()->createElement($component->getQtiClassName());

        $fieldIdentifer = $component->getFieldIdentifier();
        $baseType = $component->getBaseType();

        self::setDOMElementValue($element, $component->getValue());

        if (!empty($fieldIdentifer)) {
            $this->setDOMElementAttribute($element, 'fieldIdentifier', $fieldIdentifer);
        }

        if ($component->isPartOfRecord() && $baseType >= 0) {
            $this->setDOMElementAttribute($element, 'baseType', BaseType::getNameByConstant($baseType));
        }

        return $element;
    }
protected function marshall ( QtiComponent $ component ) { $ element = static :: getDOMCradle ( ) -> createElement ( $ component -> getQtiClassName ( ) ) ; $ fieldIdentifer = $ component -> getFieldIdentifier ( ) ; $ baseType = $ component -> getBaseType ( ) ; self :: setDOMElementValue ( $ element , $ component -> getValue ( ) ) ; if ( ! empty ( $ fieldIdentifer ) ) { $ this -> setDOMElementAttribute ( $ element , 'fieldIdentifier' , $ fieldIdentifer ) ; } if ( $ component -> isPartOfRecord ( ) && $ baseType >= 0 ) { $ this -> setDOMElementAttribute ( $ element , 'baseType' , BaseType :: getNameByConstant ( $ baseType ) ) ; } return $ element ; }
Marshall a Value object into a DOMElement object.

@param \qtism\data\QtiComponent $component A Value object.
@return \DOMElement The according DOMElement object.
Marshall a Value object into a DOMElement object .