PHP Class pQuery\HtmlSelector

Mostrar archivo Open project: tburry/pquery

Public Properties

Property Type Description
$custom_filter_map array Extra function map for custom filters
$parser CSSQueryTokenizer Parser object
$query string Last performed query, result in {@link $result}
$result array Array of matching nodes
$root DomNode Target of queries
$search_recursive boolean Search recursively
$search_root boolean Include root in search, if false the only child nodes are evaluated

Public Methods

Method Description
__construct ( DomNode $root, string $query = '*', boolean $search_root = false, boolean $search_recursive = true, CSSQueryTokenizer $parser = null ) Class constructor
__invoke ( $query = '*' ) : array Class magic invoke method, performs {@link select()}
__toString ( ) : string toString method, returns {@link $query}
select ( string $query = '*' ) : array Perform query

Protected Methods

Method Description
error ( string $error ) Trigger error
parse ( ) : boolean Parse full query
parse_adjacent ( ) : boolean Evaluate sibling nodes
parse_callback ( array $conditions, boolean | integer $recursive = true, boolean $check_root = false ) : array Evaluate root node using custom callback
parse_conditions ( ) : array Get query conditions (tag, attribute and filter conditions)
parse_getIdentifier ( boolean $do_error = true ) : string Get identifier (parse identifier or string)
parse_result ( boolean $parent = false, boolean | integer $recursive = true ) : boolean Evaluate {@link $result}
parse_single ( boolean | integer $recursive = true ) : boolean Parse first bit of query, only root node has to be evaluated now

Method Details

__construct() public method

Class constructor
public __construct ( DomNode $root, string $query = '*', boolean $search_root = false, boolean $search_recursive = true, CSSQueryTokenizer $parser = null )
$root DomNode {@link $root}
$query string
$search_root boolean {@link $search_root}
$search_recursive boolean {@link $search_recursive}
$parser CSSQueryTokenizer If null, then default class will be used

__invoke() public method

Class magic invoke method, performs {@link select()}
public __invoke ( $query = '*' ) : array
return array

__toString() public method

toString method, returns {@link $query}
public __toString ( ) : string
return string

error() protected method

Trigger error
protected error ( string $error )
$error string

parse() protected method

Parse full query
protected parse ( ) : boolean
return boolean

parse_adjacent() protected method

Evaluate sibling nodes
protected parse_adjacent ( ) : boolean
return boolean

parse_callback() protected method

Evaluate root node using custom callback
protected parse_callback ( array $conditions, boolean | integer $recursive = true, boolean $check_root = false ) : array
$conditions array {@link parse_conditions()}
$recursive boolean | integer
$check_root boolean
return array

parse_conditions() protected method

Get query conditions (tag, attribute and filter conditions)
See also: DomNode::match()
protected parse_conditions ( ) : array
return array False on failure

parse_getIdentifier() protected method

Get identifier (parse identifier or string)
protected parse_getIdentifier ( boolean $do_error = true ) : string
$do_error boolean Error on failure
return string False on failure

parse_result() protected method

Evaluate {@link $result}
protected parse_result ( boolean $parent = false, boolean | integer $recursive = true ) : boolean
$parent boolean Evaluate parent nodes
$recursive boolean | integer
return boolean

parse_single() protected method

Parse first bit of query, only root node has to be evaluated now
protected parse_single ( boolean | integer $recursive = true ) : boolean
$recursive boolean | integer
return boolean

select() public method

Perform query
public select ( string $query = '*' ) : array
$query string
return array False on failure

Property Details

$custom_filter_map public_oe property

Extra function map for custom filters
See also: DomNode::$filter_map
public array $custom_filter_map
return array

$parser public_oe property

Parser object
public CSSQueryTokenizer,pquery $parser
return CSSQueryTokenizer

$query public_oe property

Last performed query, result in {@link $result}
public string $query
return string

$result public_oe property

Array of matching nodes
public array $result
return array

$root public_oe property

Target of queries
public DomNode,pquery $root
return DomNode

$search_recursive public_oe property

Search recursively
public bool $search_recursive
return boolean

$search_root public_oe property

Include root in search, if false the only child nodes are evaluated
public bool $search_root
return boolean