API Documentation

Search/Lucene/Document/Html.php

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Search_Lucene  
subpackage
Document  
version
$Id: Html.php 24144 2011-06-14 22:06:56Z adamlundrigan $  

\Zend_Search_Lucene_Document_Html

HTML document.

Extends from
\Zend_Search_Lucene_Document
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Search_Lucene  
subpackage
Document  

Properties

Propertyprivate\DOMDocument  $_doc= ''

Stored DOM representation

Details
Type
\DOMDocument
Propertyprivateboolean  $_excludeNoFollowLinks= 'false'
static

Exclud nofollow links flag

If true then links with rel='nofollow' attribute are not included into document links.

Default valuefalseDetails
Type
boolean
Propertyprivatearray  $_headerLinks= 'array'

List of document header links

Default valuearrayDetails
Type
array
Propertyprivatearray  $_inlineTags= 'array'

List of inline tags

Default valuearrayDetails
Type
array
Propertyprivatearray  $_links= 'array'

List of document links

Default valuearrayDetails
Type
array

Methods

methodprivate__construct( string $data, boolean $isFile, boolean $storeContent, string $defaultEncoding ) : void

Object constructor

Parameters
Name Type Description
$data string

HTML string (may be HTML fragment, )

$isFile boolean
$storeContent boolean
$defaultEncoding string

HTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag.

methodpublic__get( string $offset ) : string

Proxy method for getFieldValue(), provides more convenient access to the string value of a field.

Inherited from: \Zend_Search_Lucene_Document::__get()
Parameters
Name Type Description
$offset string
Returns
Type Description
string
methodprotected_highlightNodeRecursive( \DOMNode $contextNode, array $wordsToHighlight, callback $callback, array $params ) : void

highlight words in content of the specified node

Parameters
Name Type Description
$contextNode \DOMNode
$wordsToHighlight array
$callback callback

Callback method, used to transform (highlighting) text.

$params array

Array of additionall callback parameters (first non-optional parameter is a text to transform)

methodprotected_highlightTextNode( \DOMText $node, array $wordsToHighlight, callback $callback, array $params ) : void

Highlight text in text node

Parameters
Name Type Description
$node \DOMText
$wordsToHighlight array
$callback callback

Callback method, used to transform (highlighting) text.

$params array

Array of additionall callback parameters (first non-optional parameter is a text to transform)

Throws
Exception Description
\Zend_Search_Lucene_Exception
methodprivate_retrieveNodeText( \DOMNode $node, string $text ) : void

Get node text

We should exclude scripts, which may be not included into comment tags, CDATA sections,

Parameters
Name Type Description
$node \DOMNode
$text string

&$text

methodpublicaddField( \Zend_Search_Lucene_Field $field ) : \Zend_Search_Lucene_Document

Add a field object to this document.

Inherited from: \Zend_Search_Lucene_Document::addField()
Parameters
Name Type Description
$field \Zend_Search_Lucene_Field
Returns
Type Description
\Zend_Search_Lucene_Document
methodpublicgetExcludeNoFollowLinks( ) : boolean
static

Get exclude nofollow links flag

Returns
Type Description
boolean
methodpublicgetField( string $fieldName ) : \Zend_Search_Lucene_Field

Returns Zend_Search_Lucene_Field object for a named field in this document.

Inherited from: \Zend_Search_Lucene_Document::getField()
Parameters
Name Type Description
$fieldName string
Returns
Type Description
\Zend_Search_Lucene_Field
methodpublicgetFieldNames( ) : array

Return an array with the names of the fields in this document.

Inherited from: \Zend_Search_Lucene_Document::getFieldNames()
Returns
Type Description
array
methodpublicgetFieldUtf8Value(  $fieldName ) : string

Returns the string value of a named field in UTF-8 encoding.

Inherited from: \Zend_Search_Lucene_Document::getFieldUtf8Value()
Parameters
Name Type Description
$fieldName
Returns
Type Description
string
Details
see
\__get()  
methodpublicgetFieldValue(  $fieldName ) : string

Returns the string value of a named field in this document.

Inherited from: \Zend_Search_Lucene_Document::getFieldValue()
Parameters
Name Type Description
$fieldName
Returns
Type Description
string
Details
see
\__get()  
methodpublicgetHTML( ) : string

Get HTML

Returns
Type Description
string
methodpublicgetHeaderLinks( ) : array

Get document header links

Returns
Type Description
array
methodpublicgetHtmlBody( ) : string

Get HTML body

Returns
Type Description
string
methodpublicgetLinks( ) : array

Get document HREF links

Returns
Type Description
array
methodpublichighlight( string|array $words, string $colour = #66ffff ) : string

Highlight text with specified color

Parameters
Name Type Description
$words string|array
$colour string
Returns
Type Description
string
methodpublichighlightExtended( string|array $words, callback $callback, array $params = array ) : string

Highlight text using specified View helper or callback function.

Parameters
Name Type Description
$words string|array Words to highlight. Words could be organized using the array or string.
$callback callback

Callback method, used to transform (highlighting) text.

$params array

Array of additionall callback parameters passed through into it (first non-optional parameter is an HTML fragment for highlighting)

Returns
Type Description
string
Throws
Exception Description
\Zend_Search_Lucene_Exception
methodpublicloadHTML( string $data, boolean $storeContent = false, string $defaultEncoding ) : \Zend_Search_Lucene_Document_Html
static

Load HTML document from a string

Parameters
Name Type Description
$data string
$storeContent boolean
$defaultEncoding string

HTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag.

Returns
Type Description
\Zend_Search_Lucene_Document_Html
methodpublicloadHTMLFile( string $file, boolean $storeContent = false, string $defaultEncoding ) : \Zend_Search_Lucene_Document_Html
static

Load HTML document from a file

Parameters
Name Type Description
$file string
$storeContent boolean
$defaultEncoding string

HTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag.

Returns
Type Description
\Zend_Search_Lucene_Document_Html
methodpublicsetExcludeNoFollowLinks( boolean $newValue ) : void
static

Set exclude nofollow links flag

Parameters
Name Type Description
$newValue boolean
Documentation was generated by DocBlox 0.13.3.