public function marshall()
    {
        $toMarshall = $this->getToMarshall();

        try {
            if ($toMarshall instanceof QtiCoords) {
                $this->marshallCoords();

                return;
            } elseif ($toMarshall instanceof QtiPair) {
                $this->marshallPair();

                return;
            } elseif ($toMarshall instanceof QtiDuration) {
                $this->marshallDuration();

                return;
            } elseif ($toMarshall instanceof QtiPoint) {
                $this->marshallPoint();

                return;
            } else if ($toMarshall instanceof QtiIdentifier) {
                $this->marshallIdentifier();
                
                return;
            }
        } catch (PhpMarshallingException $e) {
            $msg = "An error occured while marshalling a QtiDatatype object.";
            throw new PhpMarshallingException($msg, PhpMarshallingException::RUNTIME, $e);
        }

        $className = get_class($toMarshall);
        $msg = "Cannot deal with QtiDatatype '${className}'.";
        throw new PhpMarshallingException($msg, PhpMarshallingException::RUNTIME);
    }
public function marshall()
    {
        $toMarshall = $this->getToMarshall();

        try {
            if ($toMarshall instanceof QtiCoords) {
                $this->marshallCoords();

                return;
            } elseif ($toMarshall instanceof QtiPair) {
                $this->marshallPair();

                return;
            } elseif ($toMarshall instanceof QtiDuration) {
                $this->marshallDuration();

                return;
            } elseif ($toMarshall instanceof QtiPoint) {
                $this->marshallPoint();

                return;
            } else if ($toMarshall instanceof QtiIdentifier) {
                $this->marshallIdentifier();
                
                return;
            }
        } catch (PhpMarshallingException $e) {
            $msg = "An error occured while marshalling a QtiDatatype object.";
            throw new PhpMarshallingException($msg, PhpMarshallingException::RUNTIME, $e);
        }

        $className = get_class($toMarshall);
        $msg = "Cannot deal with QtiDatatype '${className}'.";
        throw new PhpMarshallingException($msg, PhpMarshallingException::RUNTIME);
    }
public function marshall ( ) { $ toMarshall = $ this -> getToMarshall ( ) ; try { if ( $ toMarshall instanceof QtiCoords ) { $ this -> marshallCoords ( ) ; return ; } elseif ( $ toMarshall instanceof QtiPair ) { $ this -> marshallPair ( ) ; return ; } elseif ( $ toMarshall instanceof QtiDuration ) { $ this -> marshallDuration ( ) ; return ; } elseif ( $ toMarshall instanceof QtiPoint ) { $ this -> marshallPoint ( ) ; return ; } else if ( $ toMarshall instanceof QtiIdentifier ) { $ this -> marshallIdentifier ( ) ; return ; } } catch ( PhpMarshallingException $ e ) { $ msg = "An error occured while marshalling a QtiDatatype object." ; throw new PhpMarshallingException ( $ msg , PhpMarshallingException :: RUNTIME , $ e ) ; } $ className = get_class ( $ toMarshall ) ; $ msg = "Cannot deal with QtiDatatype '${className}'." ; throw new PhpMarshallingException ( $ msg , PhpMarshallingException :: RUNTIME ) ; }
Marshall a QtiDatatype object into PHP source code.

@throws \qtism\data\storage\php\marshalling\PhpMarshallingException If an error occurs during marshalling.
Marshall a QtiDatatype object into PHP source code .