1 : <?php
2 : /**
3 : * Load FluentDOM from DOMNode
4 : *
5 : * @version $Id: DOMNode.php 303 2009-07-22 19:50:07Z subjective $
6 : * @license http://www.opensource.org/licenses/mit-license.php The MIT License
7 : * @copyright Copyright (c) 2009 Bastian Feder, Thomas Weinert
8 : *
9 : * @package FluentDOM
10 : * @subpackage Loaders
11 : */
12 :
13 : /**
14 : * include interface
15 : */
16 : require_once dirname(__FILE__).'/../FluentDOMLoader.php';
17 :
18 : /**
19 : * Load FluentDOM from DOMDocument
20 : *
21 : * @package FluentDOM
22 : * @subpackage Loaders
23 : */
24 : class FluentDOMLoaderDOMNode implements FluentDOMLoader {
25 :
26 : /**
27 : * attach existing DOMNode->ownerdocument and select the DOMNode
28 : *
29 : * @param object DOMNode $source
30 : * @param string $contentType
31 : * @access public
32 : * @return array | FALSE
33 : */
34 : public function load($source, $contentType) {
35 8 : if ($source instanceof DOMNode) {
36 6 : return array($source->ownerDocument, array($source));
37 : }
38 2 : return FALSE;
39 : }
40 : }
41 :
|