PHP 클래스 ModelSearch

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

보호된 프로퍼티들

프로퍼티 타입 설명
$criteria CDbCriteria
$itemsPerPage integer
$model BaseActiveRecord
$request Request
$searchItems array
$searchTerms array

공개 메소드들

메소드 설명
__construct ( BaseActiveRecord $model )
addActiveFilter ( )
addSearchItem ( $key, string | array $search = '' ) Add a search item.
getCriteria ( ) : CDbCriteria
getItemsPerPage ( ) : integer
getModel ( ) : BaseActiveRecord
getRequest ( ) : mixed
getSearchItems ( ) : array
getSearchTermForAttribute ( $attribute, string $default = '' ) : string Retrieves the search term supplied by the user for a given attribute if there was one.
initPagination ( ) : CPagination Inits pagination for the results and returns it.
initSearch ( $searchInput )
retrieveResults ( ) : CActiveRecord[] Performs the query that has been generated.
setCriteria ( CDbCriteria $criteria )
setItemsPerPage ( integer $itemsPerPage )
setModel ( BaseActiveRecord $model )
setRequest ( mixed $request )
setSearchItems ( array $searchItems )

보호된 메소드들

메소드 설명
addCompare ( CDbCriteria $criteria, $attribute, $value, boolean $sensitive = false, string $operator = 'AND', $exactmatch = false ) Adds a comparison between a search term and an attribute.
generateCriteria ( string | array $attr = 'search' ) Generates the required Criteria object for the search.
relationalAttribute ( CDbCriteria $criteria, string $attribute, string $search ) : string Takes an attribute name and makes sure appropriate relationships are included.

메소드 상세

__construct() 공개 메소드

public __construct ( BaseActiveRecord $model )
$model BaseActiveRecord

addActiveFilter() 공개 메소드

public addActiveFilter ( )

addCompare() 보호된 메소드

Adds a comparison between a search term and an attribute.
protected addCompare ( CDbCriteria $criteria, $attribute, $value, boolean $sensitive = false, string $operator = 'AND', $exactmatch = false )
$criteria CDbCriteria
$attribute
$value
$sensitive boolean
$operator string

addSearchItem() 공개 메소드

Add a search item.
public addSearchItem ( $key, string | array $search = '' )
$key
$search string | array

generateCriteria() 보호된 메소드

Generates the required Criteria object for the search.
protected generateCriteria ( string | array $attr = 'search' )
$attr string | array

getCriteria() 공개 메소드

public getCriteria ( ) : CDbCriteria
리턴 CDbCriteria

getItemsPerPage() 공개 메소드

public getItemsPerPage ( ) : integer
리턴 integer

getModel() 공개 메소드

public getModel ( ) : BaseActiveRecord
리턴 BaseActiveRecord

getRequest() 공개 메소드

public getRequest ( ) : mixed
리턴 mixed

getSearchItems() 공개 메소드

public getSearchItems ( ) : array
리턴 array

getSearchTermForAttribute() 공개 메소드

Retrieves the search term supplied by the user for a given attribute if there was one.
public getSearchTermForAttribute ( $attribute, string $default = '' ) : string
$attribute
$default string
리턴 string

initPagination() 공개 메소드

Inits pagination for the results and returns it.
public initPagination ( ) : CPagination
리턴 CPagination

initSearch() 공개 메소드

public initSearch ( $searchInput )
$searchInput

relationalAttribute() 보호된 메소드

This will take an attribute name many layers of relationship deep, make sure that all appropriate tables are included with the result and return a string that is then acceptable to be used in a where clause.
protected relationalAttribute ( CDbCriteria $criteria, string $attribute, string $search ) : string
$criteria CDbCriteria
$attribute string
$search string
리턴 string

retrieveResults() 공개 메소드

Performs the query that has been generated.
public retrieveResults ( ) : CActiveRecord[]
리턴 CActiveRecord[]

setCriteria() 공개 메소드

public setCriteria ( CDbCriteria $criteria )
$criteria CDbCriteria

setItemsPerPage() 공개 메소드

public setItemsPerPage ( integer $itemsPerPage )
$itemsPerPage integer

setModel() 공개 메소드

public setModel ( BaseActiveRecord $model )
$model BaseActiveRecord

setRequest() 공개 메소드

public setRequest ( mixed $request )
$request mixed

setSearchItems() 공개 메소드

public setSearchItems ( array $searchItems )
$searchItems array

프로퍼티 상세

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

protected CDbCriteria $criteria
리턴 CDbCriteria

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

protected int $itemsPerPage
리턴 integer

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

protected BaseActiveRecord $model
리턴 BaseActiveRecord

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

protected Request $request
리턴 Request

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

protected array $searchItems
리턴 array

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

protected array $searchTerms
리턴 array