PHP 클래스 yii\sphinx\Schema

부터: 2.0
저자: Paul Klimov ([email protected])
상속: extends yii\base\Object
파일 보기 프로젝트 열기: yiisoft/yii2-sphinx

공개 프로퍼티들

프로퍼티 타입 설명
$db the Sphinx connection
$typeMap mapping from physical column types (keys) to abstract column types (values)

공개 메소드들

메소드 설명
convertException ( Exception $e, string $rawSql ) : Exception Converts a DB exception to a more concrete one if possible.
createQueryBuilder ( ) : QueryBuilder Creates a query builder for the Sphinx.
getIndexNames ( boolean $refresh = false ) : string[] Returns all index names in the Sphinx.
getIndexSchema ( string $name, boolean $refresh = false ) : IndexSchema | null Obtains the metadata for the named index.
getIndexSchemas ( boolean $refresh = false ) : IndexSchema[] Returns the metadata for all indexes in the database.
getIndexTypes ( boolean $refresh = false ) : array Returns all index types in the Sphinx.
getPdoType ( mixed $data ) : integer Determines the PDO type for the given PHP data value.
getQueryBuilder ( ) : QueryBuilder
getRawIndexName ( string $name ) : string Returns the actual name of a given index name.
isReadQuery ( string $sql ) : boolean Returns a value indicating whether a SQL statement is for read purpose.
quoteColumnName ( string $name ) : string Quotes a column name for use in a query.
quoteIndexName ( string $name ) : string Quotes a index name for use in a query.
quoteSimpleColumnName ( string $name ) : string Quotes a column name for use in a query.
quoteSimpleIndexName ( string $name ) : string Quotes a index name for use in a query.
quoteValue ( string $str ) : string Quotes a string value for use in a query.
refresh ( ) Refreshes the schema.

보호된 메소드들

메소드 설명
applyDefaultColumns ( IndexSchema $index ) Sets up the default columns for given index.
findColumns ( IndexSchema $index ) : boolean Collects the metadata of index columns.
findIndexes ( ) : array Returns all index names in the Sphinx.
getCacheKey ( string $name ) : mixed Returns the cache key for the specified index name.
getCacheTag ( ) : string Returns the cache tag name.
getColumnPhpType ( ColumnSchema $column ) : string Extracts the PHP type from abstract DB type.
initIndexesInfo ( ) Initializes information about name and type of all index in the Sphinx.
loadColumnSchema ( array $info ) : ColumnSchema Loads the column information into a ColumnSchema object.
loadIndexSchema ( string $name ) : IndexSchema | null Loads the metadata for the specified index.
resolveIndexNames ( IndexSchema $index, string $name ) Resolves the index name.
resolveIndexType ( IndexSchema $index ) Resolves the index name.

메소드 상세

applyDefaultColumns() 보호된 메소드

This method should be used in case there is no way to find actual columns, like in some distributed indexes.
부터: 2.0.6
protected applyDefaultColumns ( IndexSchema $index )
$index IndexSchema the index metadata

convertException() 공개 메소드

Converts a DB exception to a more concrete one if possible.
public convertException ( Exception $e, string $rawSql ) : Exception
$e Exception
$rawSql string SQL that produced exception
리턴 yii\db\Exception

createQueryBuilder() 공개 메소드

Creates a query builder for the Sphinx.
public createQueryBuilder ( ) : QueryBuilder
리턴 QueryBuilder query builder instance

findColumns() 보호된 메소드

Collects the metadata of index columns.
protected findColumns ( IndexSchema $index ) : boolean
$index IndexSchema the index metadata
리턴 boolean whether the index exists in the database

findIndexes() 보호된 메소드

Returns all index names in the Sphinx.
protected findIndexes ( ) : array
리턴 array all index names in the Sphinx.

getCacheKey() 보호된 메소드

Returns the cache key for the specified index name.
protected getCacheKey ( string $name ) : mixed
$name string the index name
리턴 mixed the cache key

getCacheTag() 보호된 메소드

This allows Schema::refresh to invalidate all cached index schemas.
protected getCacheTag ( ) : string
리턴 string the cache tag name

getColumnPhpType() 보호된 메소드

Extracts the PHP type from abstract DB type.
protected getColumnPhpType ( ColumnSchema $column ) : string
$column ColumnSchema the column schema information
리턴 string PHP type name

getIndexNames() 공개 메소드

Returns all index names in the Sphinx.
public getIndexNames ( boolean $refresh = false ) : string[]
$refresh boolean whether to fetch the latest available index names. If this is false, index names fetched previously (if available) will be returned.
리턴 string[] all index names in the Sphinx.

getIndexSchema() 공개 메소드

Obtains the metadata for the named index.
public getIndexSchema ( string $name, boolean $refresh = false ) : IndexSchema | null
$name string index name. The index name may contain schema name if any. Do not quote the index name.
$refresh boolean whether to reload the index schema even if it is found in the cache.
리턴 IndexSchema | null index metadata. `null` - if the named index does not exist.

getIndexSchemas() 공개 메소드

Returns the metadata for all indexes in the database.
public getIndexSchemas ( boolean $refresh = false ) : IndexSchema[]
$refresh boolean whether to fetch the latest available index schemas. If this is false, cached data may be returned if available.
리턴 IndexSchema[] the metadata for all indexes in the Sphinx. Each array element is an instance of [[IndexSchema]] or its child class.

getIndexTypes() 공개 메소드

Returns all index types in the Sphinx.
public getIndexTypes ( boolean $refresh = false ) : array
$refresh boolean whether to fetch the latest available index types. If this is false, index types fetched previously (if available) will be returned.
리턴 array all index types in the Sphinx in format: index name => index type.

getPdoType() 공개 메소드

Determines the PDO type for the given PHP data value.
또한 보기: http://www.php.net/manual/en/pdo.constants.php
public getPdoType ( mixed $data ) : integer
$data mixed the data whose PDO type is to be determined
리턴 integer the PDO type

getQueryBuilder() 공개 메소드

public getQueryBuilder ( ) : QueryBuilder
리턴 QueryBuilder the query builder for this connection.

getRawIndexName() 공개 메소드

This method will strip off curly brackets from the given index name and replace the percentage character '%' with [[Connection::indexPrefix]].
public getRawIndexName ( string $name ) : string
$name string the index name to be converted
리턴 string the real name of the given index name

initIndexesInfo() 보호된 메소드

Initializes information about name and type of all index in the Sphinx.
protected initIndexesInfo ( )

isReadQuery() 공개 메소드

Returns a value indicating whether a SQL statement is for read purpose.
public isReadQuery ( string $sql ) : boolean
$sql string the SQL statement
리턴 boolean whether a SQL statement is for read purpose.

loadColumnSchema() 보호된 메소드

Loads the column information into a ColumnSchema object.
protected loadColumnSchema ( array $info ) : ColumnSchema
$info array column information
리턴 ColumnSchema the column schema object

loadIndexSchema() 보호된 메소드

Loads the metadata for the specified index.
protected loadIndexSchema ( string $name ) : IndexSchema | null
$name string index name
리턴 IndexSchema | null driver dependent index metadata. `null` - if the index does not exist.

quoteColumnName() 공개 메소드

If the column name contains prefix, the prefix will also be properly quoted. If the column name is already quoted or contains '(', '[[' or '{{', then this method will do nothing.
또한 보기: quoteSimpleColumnName
public quoteColumnName ( string $name ) : string
$name string column name
리턴 string the properly quoted column name

quoteIndexName() 공개 메소드

If the index name contains schema prefix, the prefix will also be properly quoted. If the index name is already quoted or contains '(' or '{{', then this method will do nothing.
또한 보기: quoteSimpleTableName
public quoteIndexName ( string $name ) : string
$name string index name
리턴 string the properly quoted index name

quoteSimpleColumnName() 공개 메소드

A simple column name has no prefix.
public quoteSimpleColumnName ( string $name ) : string
$name string column name
리턴 string the properly quoted column name

quoteSimpleIndexName() 공개 메소드

A simple index name has no schema prefix.
public quoteSimpleIndexName ( string $name ) : string
$name string index name
리턴 string the properly quoted index name

quoteValue() 공개 메소드

Note that if the parameter is not a string, it will be returned without change.
또한 보기: http://www.php.net/manual/en/function.PDO-quote.php
public quoteValue ( string $str ) : string
$str string string to be quoted
리턴 string the properly quoted string

refresh() 공개 메소드

This method cleans up all cached index schemas so that they can be re-created later to reflect the Sphinx schema change.
public refresh ( )

resolveIndexNames() 보호된 메소드

Resolves the index name.
protected resolveIndexNames ( IndexSchema $index, string $name )
$index IndexSchema the index metadata object
$name string the index name

resolveIndexType() 보호된 메소드

Resolves the index name.
protected resolveIndexType ( IndexSchema $index )
$index IndexSchema the index metadata object

프로퍼티 상세

$db 공개적으로 프로퍼티

the Sphinx connection
public $db

$typeMap 공개적으로 프로퍼티

mapping from physical column types (keys) to abstract column types (values)
public $typeMap