class MysqlTable extends AbstractTable (View source)

Class MysqlTable

Methods

__construct(string $table, AbstractDatabaseDriver $db)

Constructor.

create(callable|Schema $schema, bool $ifNotExists = true, array $options = array())

create

update(callable|Schema $schema)

update

$this
save(callable|Schema $schema, bool $ifNotExists = true, array $options = array())

save

drop(bool $ifExists = true, string $option = '')

drop

boolean
exists()

exists

$this
rename(string $newName, boolean $returnNew = true)

rename

lock()

Locks a table in the database.

truncate()

Method to truncate a table.

array|boolean
getDetail()

getDetail

array
getColumns(bool $refresh = false)

Get table columns.

mixed
getColumnDetails(bool $refresh = false)

getColumnDetails

getColumnDetail(string $column)

getColumnDetail

boolean
hasColumn(string $column)

hasColumn

addColumn(string $name, string $type = 'text', bool $signed = true, bool $allowNull = true, string $default = '', string $comment = '', array $options = array())

addColumn

dropColumn(string $name)

dropColumn

modifyColumn(string|Column $name, string $type = 'text', bool $signed = true, bool $allowNull = true, string $default = '', string $comment = '', array $options = array())

modifyColumn

changeColumn(string $oldName, string|Column $newName, string $type = 'text', bool $signed = true, bool $allowNull = true, string $default = '', string $comment = '', array $options = array())

changeColumn

addIndex(string $type, array $columns = array(), string $name = null, string $comment = null, array $options = array())

addIndex

dropIndex(string $name)

dropIndex

array
getIndexes()

getIndexes

boolean
hasIndex(string $name)

hasIndex

string
getName()

Method to get property Table

setName(string $name)

Method to set property table

getDriver()

Method to get property Db

setDriver(AbstractDatabaseDriver $db)

Method to set property db

getSchema()

getSchema

getDatabase()

Method to get property Database

setDatabase(AbstractDatabase $database)

Method to set property database

getDataType()

getTypeMapper

Details

__construct(string $table, AbstractDatabaseDriver $db)

Constructor.

Parameters

string $table
AbstractDatabaseDriver $db

at line line 33
AbstractTable create(callable|Schema $schema, bool $ifNotExists = true, array $options = array())

create

Parameters

callable|Schema $schema
bool $ifNotExists
array $options

Return Value

AbstractTable

AbstractTable update(callable|Schema $schema)

update

Parameters

callable|Schema $schema

Return Value

AbstractTable

$this save(callable|Schema $schema, bool $ifNotExists = true, array $options = array())

save

Parameters

callable|Schema $schema
bool $ifNotExists
array $options

Return Value

$this

AbstractTable drop(bool $ifExists = true, string $option = '')

drop

Parameters

bool $ifExists
string $option

Return Value

AbstractTable

boolean exists()

exists

Return Value

boolean

at line line 322
$this rename(string $newName, boolean $returnNew = true)

rename

Parameters

string $newName
boolean $returnNew

Return Value

$this

AbstractTable lock()

Locks a table in the database.

Return Value

AbstractTable Returns this object to support chaining.

Exceptions

RuntimeException

AbstractTable unlock()

unlock

Return Value

AbstractTable Returns this object to support chaining.

Exceptions

RuntimeException

AbstractTable truncate()

Method to truncate a table.

Return Value

AbstractTable

Exceptions

RuntimeException

array|boolean getDetail()

getDetail

Return Value

array|boolean

array getColumns(bool $refresh = false)

Get table columns.

Parameters

bool $refresh

Return Value

array Table columns with type.

at line line 343
mixed getColumnDetails(bool $refresh = false)

getColumnDetails

Parameters

bool $refresh

Return Value

mixed

stdClass getColumnDetail(string $column)

getColumnDetail

Parameters

string $column

Return Value

stdClass

boolean hasColumn(string $column)

hasColumn

Parameters

string $column

Return Value

boolean

at line line 98
AbstractTable addColumn(string $name, string $type = 'text', bool $signed = true, bool $allowNull = true, string $default = '', string $comment = '', array $options = array())

addColumn

Parameters

string $name
string $type
bool $signed
bool $allowNull
string $default
string $comment
array $options

Return Value

AbstractTable

AbstractTable dropColumn(string $name)

dropColumn

Parameters

string $name

Return Value

AbstractTable

at line line 143
AbstractTable modifyColumn(string|Column $name, string $type = 'text', bool $signed = true, bool $allowNull = true, string $default = '', string $comment = '', array $options = array())

modifyColumn

Parameters

string|Column $name
string $type
bool $signed
bool $allowNull
string $default
string $comment
array $options

Return Value

AbstractTable

at line line 201
AbstractTable changeColumn(string $oldName, string|Column $newName, string $type = 'text', bool $signed = true, bool $allowNull = true, string $default = '', string $comment = '', array $options = array())

changeColumn

Parameters

string $oldName
string|Column $newName
string $type
bool $signed
bool $allowNull
string $default
string $comment
array $options

Return Value

AbstractTable

at line line 257
AbstractTable addIndex(string $type, array $columns = array(), string $name = null, string $comment = null, array $options = array())

addIndex

Parameters

string $type
array $columns
string $name
string $comment
array $options

Return Value

AbstractTable

at line line 300
AbstractTable dropIndex(string $name)

dropIndex

Parameters

string $name

Return Value

AbstractTable

at line line 360
array getIndexes()

getIndexes

Return Value

array

boolean hasIndex(string $name)

hasIndex

Parameters

string $name

Return Value

boolean

string getName()

Method to get property Table

Return Value

string

AbstractTable setName(string $name)

Method to set property table

Parameters

string $name

Return Value

AbstractTable Return self to support chaining.

AbstractDatabaseDriver getDriver()

Method to get property Db

Return Value

AbstractDatabaseDriver

AbstractTable setDriver(AbstractDatabaseDriver $db)

Method to set property db

Parameters

AbstractDatabaseDriver $db

Return Value

AbstractTable Return self to support chaining.

Schema getSchema()

getSchema

Return Value

Schema

AbstractDatabase getDatabase()

Method to get property Database

Return Value

AbstractDatabase

AbstractTable setDatabase(AbstractDatabase $database)

Method to set property database

Parameters

AbstractDatabase $database

Return Value

AbstractTable Return self to support chaining.

DataType getDataType()

getTypeMapper

Return Value

DataType

AbstractTable reset()

reset

Return Value

AbstractTable