PHP 클래스 FilterComponent, cakephp-filter

상속: extends Component
파일 보기 프로젝트 열기: josegonzalez/cakephp-filter 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$__data array Stores data for the current pagination set
$filterOptions array Holds filterOptions for 1.2 Compatibility
$paginate array Pagination array for component
$settings array actions: Actions upon which this component will act upon defaults: Holds pagination defaults for controller actions. fieldFormatting: Fields which will replace the regular syntax in where i.e. field = 'value' formOptionsDatetime: Formatting for datetime fields (unused) paginatorParams: Paginator params sent in the URL parsed: Used to tell whether the data options have been parsed redirect: Used to tell whether to redirect so the url includes filter data useTime: Used to tell whether time should be used in the filtering separator: Separator to use between fields in a date input rangeSeparator: Separator to use between dates in a date range url: Url variable used in paginate helper (array('url'=>$url)); whitelist: Array of fields and models for which this component may filter

공개 메소드들

메소드 설명
__arrayHasKeys ( array $array, array $keys, boolean $size = null ) : boolean Checks if all keys are held within an array
__buildNamedParams ( array $params ) : string Builds a named parameter list
__checkParams ( object &$controller ) : array Parses named parameters from the current GET request
__filterField ( string $model, string $filteredFieldName, $filteredFieldData, array $modelFieldNames = [] ) : array Filters an individual field
__prepareDatetime ( array $date ) : string Prepares a date array for a MySQL WHERE clause
__prepareFilter ( object &$controller ) Store sanitized version of filter data
initialize ( object &$controller, array $settings = [] ) : void Initializes FilterComponent for use in the controller
processAction ( &$controller )
processDatetime ( string $fieldname ) : null | string Builds up a selected datetime for the form helper
processFilters ( object &$controller ) : void Function which will change controller->data array

메소드 상세

__arrayHasKeys() 공개 메소드

Checks if all keys are held within an array
저자: Jose Diaz-Gonzalez
public __arrayHasKeys ( array $array, array $keys, boolean $size = null ) : boolean
$array array
$keys array
$size boolean
리턴 boolean array has keys, optional check on size of array

__buildNamedParams() 공개 메소드

Builds a named parameter list
저자: Chad Jablonski
public __buildNamedParams ( array $params ) : string
$params array An array of parameters to parse
리턴 string Parsed string of named parameters

__checkParams() 공개 메소드

Parses named parameters from the current GET request
public __checkParams ( object &$controller ) : array
$controller object Reference to controller
리턴 array Parsed params

__filterField() 공개 메소드

Filters an individual field
저자: Jose Diaz-Gonzalez
public __filterField ( string $model, string $filteredFieldName, $filteredFieldData, array $modelFieldNames = [] ) : array
$model string name of model
$filteredFieldName string
$modelFieldNames array
리턴 array

__prepareDatetime() 공개 메소드

Prepares a date array for a MySQL WHERE clause
저자: Jeffrey Marvin
public __prepareDatetime ( array $date ) : string
$date array
리턴 string

__prepareFilter() 공개 메소드

Store sanitized version of filter data
public __prepareFilter ( object &$controller )
$controller object Reference to controller

initialize() 공개 메소드

Initializes FilterComponent for use in the controller
public initialize ( object &$controller, array $settings = [] ) : void
$controller object A reference to the instantiating controller object
$settings array Array of settings for the Component
리턴 void

processAction() 공개 메소드

public processAction ( &$controller )

processDatetime() 공개 메소드

Builds up a selected datetime for the form helper
public processDatetime ( string $fieldname ) : null | string
$fieldname string the name of the field to process
리턴 null | string

processFilters() 공개 메소드

Function which will change controller->data array
public processFilters ( object &$controller ) : void
$controller object Reference to controller
리턴 void

프로퍼티 상세

$__data 공개적으로 프로퍼티

Stores data for the current pagination set
public array $__data
리턴 array

$filterOptions 공개적으로 프로퍼티

Holds filterOptions for 1.2 Compatibility
public array $filterOptions
리턴 array

$paginate 공개적으로 프로퍼티

Pagination array for component
public array $paginate
리턴 array

$settings 공개적으로 프로퍼티

actions: Actions upon which this component will act upon defaults: Holds pagination defaults for controller actions. fieldFormatting: Fields which will replace the regular syntax in where i.e. field = 'value' formOptionsDatetime: Formatting for datetime fields (unused) paginatorParams: Paginator params sent in the URL parsed: Used to tell whether the data options have been parsed redirect: Used to tell whether to redirect so the url includes filter data useTime: Used to tell whether time should be used in the filtering separator: Separator to use between fields in a date input rangeSeparator: Separator to use between dates in a date range url: Url variable used in paginate helper (array('url'=>$url)); whitelist: Array of fields and models for which this component may filter
public array $settings
리턴 array