. */ /** * Collection * * This file contains the class AmazonProduct_Collection * * @author Matthew John Denton * @package com.mdbitz.amazon.product */ /** * AmazonProduct_Collection defines the Collection object * * Properties * * * @package com.mdbitz.amazon.product */ class AmazonProduct_Collection extends AmazonProduct_Abstract { /** * parse Object from XML * * @param XMLNode $node xml node to parse * @return void */ public function parseXML( $node ) { $this->set( "Items", array() ); foreach ( $node->childNodes as $item ) { switch( $item->nodeName ) { case "CollectionParent": $this->set( $item->nodeName, new AmazonProduct_CollectionItem( $item ) ); break; case "CollectionItem": $objects = $this->Items; $objects[] = new AmazonProduct_CollectionItem( $item );; $this->set( "Items", $objects ); break; default: $this->processNode( $node ); break; } } } }