| @@ 740-750 (lines=11) @@ | ||
| 737 | } |
|
| 738 | } |
|
| 739 | ||
| 740 | function _getPosition( $el ) { |
|
| 741 | if ( is_array($el) || $el instanceof Traversable ) { |
|
| 742 | return $this->_getPosition( reset($el) ); |
|
| 743 | } else { |
|
| 744 | foreach ( $this as $pos => $node ) { |
|
| 745 | if ( $node === $el ) { |
|
| 746 | return $pos; |
|
| 747 | } |
|
| 748 | } |
|
| 749 | } |
|
| 750 | } |
|
| 751 | ||
| 752 | function _getLastPosition( $el ) { |
|
| 753 | if ( is_array($el) || $el instanceof Traversable ) { |
|
| @@ 752-762 (lines=11) @@ | ||
| 749 | } |
|
| 750 | } |
|
| 751 | ||
| 752 | function _getLastPosition( $el ) { |
|
| 753 | if ( is_array($el) || $el instanceof Traversable ) { |
|
| 754 | return $this->_getLastPosition( end($el) ); |
|
| 755 | } else { |
|
| 756 | foreach ( $this as $pos => $node ) { |
|
| 757 | if ( $node === $el ) { |
|
| 758 | return $pos+1; |
|
| 759 | } |
|
| 760 | } |
|
| 761 | } |
|
| 762 | } |
|
| 763 | ||
| 764 | private function _removeChildNodes( $el ) { |
|
| 765 | if ( isset( $this->parentNode ) ) { |
|