PHP Class pQuery\HtmlSelector

Afficher le fichier Open project: tburry/pquery

Méthodes publiques

Свойство 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

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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 méthode

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 méthode

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

__toString() public méthode

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

error() protected méthode

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

parse() protected méthode

Parse full query
protected parse ( ) : boolean
Résultat boolean

parse_adjacent() protected méthode

Evaluate sibling nodes
protected parse_adjacent ( ) : boolean
Résultat boolean

parse_callback() protected méthode

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
Résultat array

parse_conditions() protected méthode

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

parse_getIdentifier() protected méthode

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

parse_result() protected méthode

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

parse_single() protected méthode

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

select() public méthode

Perform query
public select ( string $query = '*' ) : array
$query string
Résultat 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
Résultat array

$parser public_oe property

Parser object
public CSSQueryTokenizer,pquery $parser
Résultat CSSQueryTokenizer

$query public_oe property

Last performed query, result in {@link $result}
public string $query
Résultat string

$result public_oe property

Array of matching nodes
public array $result
Résultat array

$root public_oe property

Target of queries
public DomNode,pquery $root
Résultat DomNode

$search_recursive public_oe property

Search recursively
public bool $search_recursive
Résultat boolean

$search_root public_oe property

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