PHP 트레잇 Devise\Search\SearchableModelTrait

where numbers 1 and 2 are the respective relevance of those columns
파일 보기 프로젝트 열기: devisephp/cms

보호된 프로퍼티들

프로퍼티 타입 설명
$totalWords integer

공개 메소드들

메소드 설명
scopeSearch ( $query, $search ) : mixed Makes the search process work for a model

보호된 메소드들

메소드 설명
addSelectsToQuery ( &$query, $selects ) Puts all the select clauses to the main query
createSearchQuery ( Query $query, text $search ) : Query Makes the search query to search for text by relevance inside the database using IF statements
filterCommonWords ( array $words ) : array Filter out words like a, the, but, and, her, his, etc <-- even that one
filterQueryWithRelevance ( &$query, $relevance_count ) Adds where clauses to this query based on the relevance
getColumns ( ) : array Returns the search columns
getJoins ( ) : array Returns the tables that has to join
getSearchQueriesForColumn ( string $column, integer $relevance, array $words ) : array Overrides how the relevance is calculated
makeJoins ( &$query ) Adds the join sql to the query

메소드 상세

addSelectsToQuery() 보호된 메소드

Puts all the select clauses to the main query
protected addSelectsToQuery ( &$query, $selects )
$query
$selects

createSearchQuery() 보호된 메소드

Makes the search query to search for text by relevance inside the database using IF statements
protected createSearchQuery ( Query $query, text $search ) : Query
$query Query
$search text
리턴 Query

filterCommonWords() 보호된 메소드

Filter out words like a, the, but, and, her, his, etc <-- even that one
protected filterCommonWords ( array $words ) : array
$words array
리턴 array

filterQueryWithRelevance() 보호된 메소드

Adds where clauses to this query based on the relevance
protected filterQueryWithRelevance ( &$query, $relevance_count )

getColumns() 보호된 메소드

Returns the search columns
protected getColumns ( ) : array
리턴 array

getJoins() 보호된 메소드

Returns the tables that has to join
protected getJoins ( ) : array
리턴 array

getSearchQueriesForColumn() 보호된 메소드

Overrides how the relevance is calculated
protected getSearchQueriesForColumn ( string $column, integer $relevance, array $words ) : array
$column string
$relevance integer
$words array
리턴 array

makeJoins() 보호된 메소드

Adds the join sql to the query
protected makeJoins ( &$query )
$query

scopeSearch() 공개 메소드

Makes the search process work for a model
public scopeSearch ( $query, $search ) : mixed
$query
$search
리턴 mixed

프로퍼티 상세

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

protected int $totalWords
리턴 integer