Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?PHP
2
/**
3
 * Model for a product finder
4
 *
5
 *
6
 * @package Services_Ebay
7
 * @author  Stephan Schmidt <schst@php.net>
8
 */
9
class Services_Ebay_Model_ProductFinder extends Services_Ebay_Model
10
{
11
   /**
12
    * stores the DOM document
13
    *
14
    * @var object
15
    */
16
    protected $dom = null;
17
 
18
   /**
19
    * create new model
20
    *
21
    * @param    array
22
    * @param    object
23
    */
24
    public function __construct($node, $session = null)
25
    {
26
        $this->dom = new DOMDocument();
27
 
28
        $ebay = new DOMElement('eBay');
29
        $ebay = $this->dom->appendChild($ebay);
30
 
31
        $pf = new DOMElement('ProductFinders');
32
        $pf = $ebay->appendChild($pf);
33
 
34
        $newNode = $this->dom->importNode($node, true);
35
        $pf->appendChild($newNode);
36
    }
37
 
38
   /**
39
    * render the product finder using an XSL stylesheet
40
    *
41
    * @access   public
42
    * @param    string      xsl stylesheet
43
    * @return   string      result of the transformation
44
    */
45
    public function render($xsl = null)
46
    {
47
        if (is_string($xsl)) {
48
            $xsl = DomDocument::loadXML($xsl);
49
        }
50
 
51
        $proc = new xsltprocessor;
52
        $proc->importStyleSheet($xsl);
53
 
54
        return $proc->transformToXML($this->dom);
55
    }
56
}
57
?>