src/Value/UserActivities/Loan.php
public static function fromXml(\DOMElement $xml)
    {
        $static = new static();
        $static->libraryItemMetadata = LibraryItemMetadata::fromXml($xml);
        $static->renewable = Renewable::fromXml($xml);

        $loanDate = $xml->getElementsByTagName('loanDate');
        $static->loanDate = DateTime::fromXml($loanDate);

        $dueDate = $xml->getElementsByTagName('dueDate');
        $static->dueDate = DateTime::fromXml($dueDate);

        $returnedDate = $xml->getElementsByTagName('returnedDate');
        $static->returnedDate = DateTime::fromXml($returnedDate);

        $stringLiterals = array(
            'pbsCode' => $xml->getElementsByTagName('pbsCode'),
            'itemSequence' => $xml->getElementsByTagName('itemSequence'),
            'material' => $xml->getElementsByTagName('material'),
        );
        foreach ($stringLiterals as $propertyName => $xmlTag) {
            $static->$propertyName = StringLiteral::fromXml($xmlTag);
        }

        return $static;
    }
public static function fromXml(\DOMElement $xml)
    {
        $static = new static();
        $static->libraryItemMetadata = LibraryItemMetadata::fromXml($xml);
        $static->renewable = Renewable::fromXml($xml);

        $loanDate = $xml->getElementsByTagName('loanDate');
        $static->loanDate = DateTime::fromXml($loanDate);

        $dueDate = $xml->getElementsByTagName('dueDate');
        $static->dueDate = DateTime::fromXml($dueDate);

        $returnedDate = $xml->getElementsByTagName('returnedDate');
        $static->returnedDate = DateTime::fromXml($returnedDate);

        $stringLiterals = array(
            'pbsCode' => $xml->getElementsByTagName('pbsCode'),
            'itemSequence' => $xml->getElementsByTagName('itemSequence'),
            'material' => $xml->getElementsByTagName('material'),
        );
        foreach ($stringLiterals as $propertyName => $xmlTag) {
            $static->$propertyName = StringLiteral::fromXml($xmlTag);
        }

        return $static;
    }
public static function fromXml ( \ DOMElement $ xml ) { $ static = new static ( ) ; $ static -> libraryItemMetadata = LibraryItemMetadata :: fromXml ( $ xml ) ; $ static -> renewable = Renewable :: fromXml ( $ xml ) ; $ loanDate = $ xml -> getElementsByTagName ( 'loanDate' ) ; $ static -> loanDate = DateTime :: fromXml ( $ loanDate ) ; $ dueDate = $ xml -> getElementsByTagName ( 'dueDate' ) ; $ static -> dueDate = DateTime :: fromXml ( $ dueDate ) ; $ returnedDate = $ xml -> getElementsByTagName ( 'returnedDate' ) ; $ static -> returnedDate = DateTime :: fromXml ( $ returnedDate ) ; $ stringLiterals = array ( 'pbsCode' => $ xml -> getElementsByTagName ( 'pbsCode' ) , 'itemSequence' => $ xml -> getElementsByTagName ( 'itemSequence' ) , 'material' => $ xml -> getElementsByTagName ( 'material' ) , ) ; foreach ( $ stringLiterals as $ propertyName => $ xmlTag ) { $ static -> $ propertyName = StringLiteral :: fromXml ( $ xmlTag ) ; } return $ static ; }
Builds a Loan object from XML.

@param \DOMElement $xml
The xml element containing the loan.

@return Loan
A loan object.
Builds a Loan object from XML .