/src/FluentDOM/Loader/DOMNode.php
PHP | 41 lines | 11 code | 4 blank | 26 comment | 2 complexity | 8226242496412ab2b45dc938d5a6e4c5 MD5 | raw file
- <?php
- /**
- * Load FluentDOM from DOMNode
- *
- * @version $Id$
- * @license http://www.opensource.org/licenses/mit-license.php The MIT License
- * @copyright Copyright (c) 2009 Bastian Feder, Thomas Weinert
- *
- * @package FluentDOM
- * @subpackage Loaders
- */
- /**
- * include interface
- */
- require_once(dirname(__FILE__).'/../Loader.php');
- /**
- * Load FluentDOM from DOMDocument
- *
- * @package FluentDOM
- * @subpackage Loaders
- */
- class FluentDOMLoaderDOMNode implements FluentDOMLoader {
- /**
- * attach existing DOMNode->ownerdocument and select the DOMNode
- *
- * @param DOMNode $source
- * @param string $contentType
- * @return DOMNode|NULL
- */
- public function load($source, &$contentType) {
- if ($source instanceof DOMNode && !empty($source->ownerDocument)) {
- return $source;
- }
- return NULL;
- }
- }
- ?>