PHP 클래스 PageFinder, ProcessWire

상속: extends Wire
파일 보기 프로젝트 열기: ryancramerdesign/ProcessWire 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$checkAccess
$defaultOptions Options (and their defaults) that may be provided as the 2nd argument to find()
$extraOrSelectors
$extraSubSelectors one from each field must match
$fieldgroups
$getQueryNumChildren
$getTotal
$getTotalType whether to find the total number of matches
$lastOptions number of times the function has been called
$limit
$parent_id
$start
$templates_id
$total May be: 'calc', 'count', or blank to auto-detect.

공개 메소드들

메소드 설명
___find ( Selectors $selectors, array $options = [] ) : array Return all pages matching the given selector.
__construct ( ) Construct the PageFinder
findIDs ( Selectors $selectors, array $options = [] ) : array Same as find() but returns just a simple array of page IDs without any other info
getLimit ( ) Returns the limit placed upon the last find() operation, or 0 if no limit was specified
getOptions ( ) Return array of the options provided to PageFinder, as well as those determined at runtime
getParentID ( ) Returns the parent ID, if it was part of the selector
getStart ( ) Returns the start placed upon the last find() operation
getTemplatesID ( ) Returns the templates ID, if it was part of the selector
getTotal ( ) : integer Returns the total number of results returned from the last find() operation

보호된 메소드들

메소드 설명
___getQuery ( array $selectors, array $options ) : DatabaseQuerySelect Given one or more selectors, create the SQL query for finding pages.
___getQueryAllowedTemplatesWhere ( DatabaseQuerySelect $query, string $where ) : string Method that allows external hooks to add to or modify the access control WHERE conditions
___getQueryJoinPath ( DatabaseQuerySelect $query, $selector ) Special case when requested value is path or URL
arrangeFields ( array $fields ) Arrange the order of field names where necessary
getQueryAllowedTemplates ( DatabaseQuerySelect $query, $options ) Determine which templates the user is allowed to view
getQueryHasParent ( DatabaseQuerySelect $query, $selector ) Make the query specific to all pages below a certain parent (children, grandchildren, great grandchildren, etc.)
getQueryNativeField ( DatabaseQuerySelect $query, Selector $selector, array $fields ) Special case when field is native to the pages table
getQueryNumChildren ( DatabaseQuerySelect $query, $selector ) Match a number of children count
getQuerySortSelector ( DatabaseQuerySelect $query, Selector $selector )
getQueryStartLimit ( DatabaseQuerySelect $query, $selectors )
postProcessQuery ( $parentQuery )
preProcessSelector ( Selector $selector ) : boolean Pre-process the given selector to perform any necessary replacements
setupStatusChecks ( Selectors $selectors, array &$options ) Pre-process the selectors to add Page status checks
whereEmptyValuePossible ( Field $field, $selector, $query, string $value, string &$where ) : boolean Generate SQL and modify $query for situations where it should be possible to match empty values

메소드 상세

___find() 공개 메소드

Return all pages matching the given selector.
public ___find ( Selectors $selectors, array $options = [] ) : array
$selectors Selectors
$options array
리턴 array

___getQuery() 보호된 메소드

Given one or more selectors, create the SQL query for finding pages.
protected ___getQuery ( array $selectors, array $options ) : DatabaseQuerySelect
$selectors array Array of selectors.
$options array
리턴 DatabaseQuerySelect

___getQueryAllowedTemplatesWhere() 보호된 메소드

Called only if it's hooked. To utilize it, modify the $where argument in a BEFORE hook or the $event->return in an AFTER hook.
protected ___getQueryAllowedTemplatesWhere ( DatabaseQuerySelect $query, string $where ) : string
$query DatabaseQuerySelect
$where string SQL string for WHERE statement, not including the actual "WHERE"
리턴 string

___getQueryJoinPath() 보호된 메소드

Special case when requested value is path or URL
protected ___getQueryJoinPath ( DatabaseQuerySelect $query, $selector )
$query DatabaseQuerySelect

__construct() 공개 메소드

Construct the PageFinder
public __construct ( )

arrangeFields() 보호된 메소드

Arrange the order of field names where necessary
protected arrangeFields ( array $fields )
$fields array

findIDs() 공개 메소드

Same as find() but returns just a simple array of page IDs without any other info
public findIDs ( Selectors $selectors, array $options = [] ) : array
$selectors Selectors
$options array
리턴 array of page IDs

getLimit() 공개 메소드

Returns the limit placed upon the last find() operation, or 0 if no limit was specified
public getLimit ( )

getOptions() 공개 메소드

Return array of the options provided to PageFinder, as well as those determined at runtime
public getOptions ( )

getParentID() 공개 메소드

Returns the parent ID, if it was part of the selector
public getParentID ( )

getQueryAllowedTemplates() 보호된 메소드

Determine which templates the user is allowed to view
protected getQueryAllowedTemplates ( DatabaseQuerySelect $query, $options )
$query DatabaseQuerySelect

getQueryHasParent() 보호된 메소드

Make the query specific to all pages below a certain parent (children, grandchildren, great grandchildren, etc.)
protected getQueryHasParent ( DatabaseQuerySelect $query, $selector )
$query DatabaseQuerySelect

getQueryNativeField() 보호된 메소드

TODO not all operators will work here, so may want to add some translation or filtering
protected getQueryNativeField ( DatabaseQuerySelect $query, Selector $selector, array $fields )
$query DatabaseQuerySelect
$selector Selector
$fields array

getQueryNumChildren() 보호된 메소드

Match a number of children count
protected getQueryNumChildren ( DatabaseQuerySelect $query, $selector )
$query DatabaseQuerySelect

getQuerySortSelector() 보호된 메소드

protected getQuerySortSelector ( DatabaseQuerySelect $query, Selector $selector )
$query DatabaseQuerySelect
$selector Selector

getQueryStartLimit() 보호된 메소드

protected getQueryStartLimit ( DatabaseQuerySelect $query, $selectors )
$query DatabaseQuerySelect

getStart() 공개 메소드

Returns the start placed upon the last find() operation
public getStart ( )

getTemplatesID() 공개 메소드

Returns the templates ID, if it was part of the selector
public getTemplatesID ( )

getTotal() 공개 메소드

If the last find() included limit, then this returns the total without the limit
public getTotal ( ) : integer
리턴 integer

postProcessQuery() 보호된 메소드

protected postProcessQuery ( $parentQuery )

preProcessSelector() 보호된 메소드

This is primarily used to handle sub-selections, i.e. "bar=foo, id=[this=that, foo=bar]"
protected preProcessSelector ( Selector $selector ) : boolean
$selector Selector
리턴 boolean Returns false if selector should be skipped over by getQuery()

setupStatusChecks() 보호된 메소드

Pre-process the selectors to add Page status checks
protected setupStatusChecks ( Selectors $selectors, array &$options )
$selectors Selectors
$options array

whereEmptyValuePossible() 보호된 메소드

This can include equals/not-equals with blank or 0, as well as greater/less-than searches that can potentially match blank or 0.
protected whereEmptyValuePossible ( Field $field, $selector, $query, string $value, string &$where ) : boolean
$field Field
$selector
$query
$value string The value presumed to be blank (passed the empty() test)
$where string SQL where string that will be modified/appended
리턴 boolean Whether or not the query was handled and modified

프로퍼티 상세

$checkAccess 보호되어 있는 프로퍼티

protected $checkAccess

$defaultOptions 보호되어 있는 프로퍼티

Options (and their defaults) that may be provided as the 2nd argument to find()
protected $defaultOptions

$extraOrSelectors 보호되어 있는 프로퍼티

protected $extraOrSelectors

$extraSubSelectors 보호되어 있는 프로퍼티

one from each field must match
protected $extraSubSelectors

$fieldgroups 보호되어 있는 프로퍼티

protected $fieldgroups

$getQueryNumChildren 보호되어 있는 프로퍼티

protected $getQueryNumChildren

$getTotal 보호되어 있는 프로퍼티

protected $getTotal

$getTotalType 보호되어 있는 프로퍼티

whether to find the total number of matches
protected $getTotalType

$lastOptions 보호되어 있는 프로퍼티

number of times the function has been called
protected $lastOptions

$limit 보호되어 있는 프로퍼티

protected $limit

$parent_id 보호되어 있는 프로퍼티

protected $parent_id

$start 보호되어 있는 프로퍼티

protected $start

$templates_id 보호되어 있는 프로퍼티

protected $templates_id

$total 보호되어 있는 프로퍼티

May be: 'calc', 'count', or blank to auto-detect.
protected $total