PHP Class Gdn_MySQLStructure, vanilla

Inheritance: extends Gdn_DatabaseStructure
ファイルを表示 Open project: vanilla/vanilla

Public Methods

Method Description
__construct ( null $Database = null )
drop ( ) Drops $this->Table() from the database.
dropColumn ( string $Name ) : boolean Drops $Name column from $this->Table().
engine ( $Engine, boolean $CheckAvailability = true )
getRowCountEstimate ( string $tableName ) : integer | null Get the estimated number of rows in a table.
hasEngine ( $Engine ) : boolean
indexSqlDb ( ) : array
renameColumn ( string $OldName, string $NewName, string $TableName = '' ) : boolean Renames a column in $this->Table().
renameTable ( string $OldName, string $NewName, boolean $UsePrefix = false ) : boolean Renames a table in the database.
view ( string $Name, $SQL ) Specifies the name of the view to create or modify.

Protected Methods

Method Description
_create ( ) Creates the table defined with $this->Table() and $this->Column().
_defineColumn ( stdClass $column, string $newColumnName = null )
_indexSql ( $Columns, boolean $KeyType = false ) : array
_indexSqlDb ( ) : array
_modify ( boolean $Explicit = false ) Modifies $this->Table() with the columns specified with $this->Column().
_quoteValue ( $Value ) : string
_supportsFulltext ( ) : boolean
getCharsetFromCollation ( string $collation ) : string Get the character set for a collation.
getTableInfo ( string $tableName ) : array? Get the high-level table information for a given table.

Method Details

__construct() public method

public __construct ( null $Database = null )
$Database null

_create() protected method

Creates the table defined with $this->Table() and $this->Column().
protected _create ( )

_defineColumn() protected method

protected _defineColumn ( stdClass $column, string $newColumnName = null )
$column stdClass
$newColumnName string For rename action only.

_indexSql() protected method

protected _indexSql ( $Columns, boolean $KeyType = false ) : array
$Columns
$KeyType boolean
return array

_indexSqlDb() protected method

protected _indexSqlDb ( ) : array
return array

_modify() protected method

Modifies $this->Table() with the columns specified with $this->Column().
protected _modify ( boolean $Explicit = false )
$Explicit boolean If TRUE, this method will remove any columns from the table that were not defined with $this->Column().

_quoteValue() protected static method

protected static _quoteValue ( $Value ) : string
$Value
return string

_supportsFulltext() protected method

protected _supportsFulltext ( ) : boolean
return boolean

drop() public method

Drops $this->Table() from the database.
public drop ( )

dropColumn() public method

Drops $Name column from $this->Table().
public dropColumn ( string $Name ) : boolean
$Name string The name of the column to drop from $this->Table().
return boolean

engine() public method

public engine ( $Engine, boolean $CheckAvailability = true )
$Engine
$CheckAvailability boolean

getCharsetFromCollation() protected method

Get the character set for a collation.
protected getCharsetFromCollation ( string $collation ) : string
$collation string The name of the collation.
return string Returns the name of the character set or an empty string if the collation was not found.

getRowCountEstimate() public method

Get the estimated number of rows in a table.
public getRowCountEstimate ( string $tableName ) : integer | null
$tableName string The name of the table to look up, without its prefix.
return integer | null Returns the estimated number of rows or **null** if the information doesn't exist.

getTableInfo() protected method

Get the high-level table information for a given table.
protected getTableInfo ( string $tableName ) : array?
$tableName string The name of the table to get the information for.
return array?

hasEngine() public method

public hasEngine ( $Engine ) : boolean
$Engine
return boolean

indexSqlDb() public method

public indexSqlDb ( ) : array
return array

renameColumn() public method

Renames a column in $this->Table().
public renameColumn ( string $OldName, string $NewName, string $TableName = '' ) : boolean
$OldName string The name of the column to be renamed.
$NewName string The new name for the column being renamed.
$TableName string
return boolean

renameTable() public method

Renames a table in the database.
public renameTable ( string $OldName, string $NewName, boolean $UsePrefix = false ) : boolean
$OldName string The name of the table to be renamed.
$NewName string The new name for the table being renamed.
$UsePrefix boolean A boolean value indicating if $this->_DatabasePrefix should be prefixed before $OldName and $NewName.
return boolean

view() public method

Specifies the name of the view to create or modify.
public view ( string $Name, $SQL )
$Name string The name of the view.